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

Fix pkgrepo.managed PPA handling for newer Ubuntu versions #63157

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions salt/modules/aptpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -1956,9 +1956,11 @@ def get_repo(repo, **kwargs):
if HAS_SOFTWAREPROPERTIES:
try:
if hasattr(softwareproperties.ppa, "PPAShortcutHandler"):
repo = softwareproperties.ppa.PPAShortcutHandler(repo).expand(
dist
)[0]
handler = softwareproperties.ppa.PPAShortcutHandler(repo)
if hasattr(handler, "expand"):
repo = handler.expand(dist)[0]
else:
repo = handler.SourceEntry().line
else:
repo = softwareproperties.ppa.expand_ppa_line(repo, dist)[0]
except NameError as name_error:
Expand Down Expand Up @@ -2040,7 +2042,11 @@ def del_repo(repo, **kwargs):
repo = LP_SRC_FORMAT.format(owner_name, ppa_name, dist)
else:
if hasattr(softwareproperties.ppa, "PPAShortcutHandler"):
repo = softwareproperties.ppa.PPAShortcutHandler(repo).expand(dist)[0]
handler = softwareproperties.ppa.PPAShortcutHandler(repo)
if hasattr(handler, "expand"):
repo = handler.expand(dist)[0]
else:
repo = handler.SourceEntry().line
else:
repo = softwareproperties.ppa.expand_ppa_line(repo, dist)[0]

Expand Down Expand Up @@ -3030,9 +3036,11 @@ def _expand_repo_def(os_name, lsb_distrib_codename=None, **kwargs):
else:
if HAS_SOFTWAREPROPERTIES:
if hasattr(softwareproperties.ppa, "PPAShortcutHandler"):
repo = softwareproperties.ppa.PPAShortcutHandler(repo).expand(dist)[
0
]
handler = softwareproperties.ppa.PPAShortcutHandler(repo)
if hasattr(handler, "expand"):
repo = handler.expand(dist)[0]
else:
repo = handler.SourceEntry().line
else:
repo = softwareproperties.ppa.expand_ppa_line(repo, dist)[0]
else:
Expand Down