saltstack-formulas / nginx-formula

Nginx Salt Formula
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
163 stars 421 forks source link

[BUG] Failure to setup on Ubuntu 22.04 due to PPA error #293

Open Seldaek opened 2 years ago

Seldaek commented 2 years ago

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 https://github.com/saltstack/salt/issues/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 https://github.com/saltstack-formulas/nginx-formula/blob/e397c899e12d62cb3d204053fddb39c470010ffe/nginx/pkg.sls#L72-L92

Additional context