Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Seldaek opened this issue May 19, 2022 · 0 comments
Open

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

Seldaek opened this issue May 19, 2022 · 0 comments
Labels

Comments

@Seldaek
Copy link

Seldaek commented May 19, 2022

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

{%- 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

@Seldaek Seldaek added the bug label May 19, 2022
DiogoMarques29 pushed a commit to infoportugal/nginx-formula that referenced this issue May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant