-
Notifications
You must be signed in to change notification settings - Fork 418
Open
Labels
Description
Your setup
Formula commit hash / release tag
Using 2.8.1 and Salt 3004.1 + Ubuntu 22.04, I get this error which seems to be caused by saltstack/salt#59065
Pillar / config used
nginx:
install_from_repo: True
Bug details
Describe the bug
The nginx_ppa_repo fails even tho it is only trying to set pkgrepo to be absent as I use the official repo.
ID: nginx_ppa_repo
Function: pkgrepo.absent
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/salt/state.py", line 2179, in call
ret = self.states[cdata["full"]](
File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 149, in __call__
return self.loader.run(run_func, *args, **kwargs)
File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 1201, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 1216, in _run_as
return _func_or_method(*args, **kwargs)
File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 1249, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/salt/states/pkgrepo.py", line 626, in absent
repo = __salt__["pkg.get_repo"](name, **kwargs)
File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 149, in __call__
return self.loader.run(run_func, *args, **kwargs)
File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 1201, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 1216, in _run_as
return _func_or_method(*args, **kwargs)
File "/usr/lib/python3/dist-packages/salt/modules/aptpkg.py", line 1850, in get_repo
repo = softwareproperties.ppa.PPAShortcutHandler(repo).expand(
AttributeError: 'PPAShortcutHandler' object has no attribute 'expand'
Steps to reproduce the bug
Expected behaviour
No error.
Attempts to fix the bug
I deleted these lines in a fork and it seems to work now
Lines 72 to 92 in e397c89
| {%- if grains.os not in ('Debian',) %} | |
| ## applies to Ubuntu and derivatives only #} | |
| nginx_ppa_repo: | |
| pkgrepo: | |
| {%- if from_ppa %} | |
| - managed | |
| {%- else %} | |
| - absent | |
| {%- endif %} | |
| {% if grains.os == 'Ubuntu' %} | |
| - ppa: nginx/{{ nginx.ppa_version }} | |
| {% else %} | |
| - name: deb http://ppa.launchpad.net/nginx/{{ nginx.ppa_version }}/ubuntu {{ grains.oscodename }} main | |
| - keyid: C300EE8C | |
| - keyserver: keyserver.ubuntu.com | |
| {% endif %} | |
| - require_in: | |
| - pkg: nginx_install | |
| - watch_in: | |
| - pkg: nginx_install | |
| {%- endif %} |
Additional context
MemoryLeak55 and A1EF