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] aptpkg.del_repo can't delete repository without components #58667

Closed
kwargs opened this issue Oct 7, 2020 · 2 comments · Fixed by #64511
Closed

[BUG] aptpkg.del_repo can't delete repository without components #58667

kwargs opened this issue Oct 7, 2020 · 2 comments · Fixed by #64511
Assignees
Labels
Bug broken, incorrect, or confusing behavior Execution-Module Linux severity-high 2nd top severity, seen by most users, causes major problems

Comments

@kwargs
Copy link

kwargs commented Oct 7, 2020

Description
aptpkg.del_repo ignores the case when the repository has no 'components'.

if s_comps.intersection(r_comps):

Setup
Add sample source.list

$ cat /etc/apt/sources.list.d/del-repo.list
deb http://dist.list stable/all/

Steps to Reproduce the behavior

$ salt-call pkg.get_repo 'deb http://dist.list stable/all/'
local:
    ----------
    architectures:
    comps:
    disabled:
        False
    dist:
        stable/all/
    file:
        /etc/apt/sources.list.d/del-repo.list
    line:
        deb http://dist.list stable/all/
    type:
        deb
    uri:
        http://dist.list
$ salt-call pkg.del_repo 'deb http://dist.list stable/all/'
Error running 'pkg.del_repo': Repo deb http://dist.list stable/all/ doesn't exist in the sources.list(s)

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
salt-call --versions-report
Salt Version:
           Salt: 2018.3.3

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.6.1
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: 1.0.7
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.17 (default, Jul 20 2020, 15:37:01)
   python-gnupg: 0.4.1
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.2.5

System Versions:
           dist: Ubuntu 18.04 bionic
         locale: UTF-8
        machine: x86_64
        release: 4.19.114-29
         system: Linux
        version: Ubuntu 18.04 bionic
@kwargs kwargs added the Bug broken, incorrect, or confusing behavior label Oct 7, 2020
@welcome
Copy link

welcome bot commented Oct 7, 2020

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at [email protected] or reach out directly to the Community Manager, Cassandra Faris via Slack. We’re glad you’ve joined our community and look forward to doing awesome things with you!

@twangboy twangboy added Linux severity-high 2nd top severity, seen by most users, causes major problems Execution-Module and removed needs-triage labels Oct 13, 2020
@twangboy twangboy added this to the Approved milestone Oct 13, 2020
@twangboy twangboy assigned cmcmarrow and unassigned twangboy Oct 13, 2020
@sagetherage sagetherage added the Phosphorus v3005.0 Release code name and version label Jun 18, 2021
@sagetherage sagetherage modified the milestones: Approved, Phosphorus Jun 18, 2021
@whytewolf whytewolf self-assigned this Feb 16, 2022
@whytewolf whytewolf removed the Phosphorus v3005.0 Release code name and version label Mar 28, 2022
@votdev
Copy link
Contributor

votdev commented Jun 20, 2023

This bug still exists in 3005.1.

remove_apt_sources_list_security_0:
  module.run:
    - pkg.del_repo:
      - repo: "deb-src [signed-by=/etc/apt/trusted.gpg.d/debian-archive-bullseye-security-automatic.gpg] http://security.debian.org/debian-security bullseye-security main contrib non-free"
[ERROR   ] An exception occurred in this state: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/salt/state.py", line 2276, 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 1228, 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 1243, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 1276, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/salt/states/module.py", line 394, in run
    return _run(**kwargs)
  File "/usr/lib/python3/dist-packages/salt/states/module.py", line 449, in _run
    func_ret = _call_function(
  File "/usr/lib/python3/dist-packages/salt/states/module.py", line 495, in _call_function
    mret = salt.utils.functools.call_function(__salt__[name], *func_args, **func_kwargs)
  File "/usr/lib/python3/dist-packages/salt/utils/functools.py", line 174, in call_function
    return salt_function(*function_args, **function_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 1228, 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 1243, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/salt/modules/aptpkg.py", line 2138, in del_repo
    raise CommandExecutionError(
salt.exceptions.CommandExecutionError: Repo deb-src [signed-by=/etc/apt/trusted.gpg.d/debian-archive-bullseye-security-automatic.gpg] http://security.debian.org/debian-security bullseye-security main contrib non-free doesn't exist in the sources.list(s)

votdev added a commit to openmediavault/openmediavault that referenced this issue Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Execution-Module Linux severity-high 2nd top severity, seen by most users, causes major problems
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants