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

pkgrepo.managed does not uncomment repos in sources.list #27067

Closed
clinta opened this issue Sep 11, 2015 · 4 comments
Closed

pkgrepo.managed does not uncomment repos in sources.list #27067

clinta opened this issue Sep 11, 2015 · 4 comments
Labels
Bug broken, incorrect, or confusing behavior P4 Priority 4 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around stale State-Module
Milestone

Comments

@clinta
Copy link
Contributor

clinta commented Sep 11, 2015

If an entry doesn't exist at all, it is added fine:

$ cat /etc/apt/sources.list
# demo sources.list file
$ sudo salt-call state.high "{'partner': {'pkgrepo': ['managed', {'name': 'deb http://archive.canonical.com/ubuntu/ trusty partner'}, {'enabled': True}, {'file': '/etc/apt/sources.list'}]}}"
[INFO    ] Loading fresh modules for state activity
[INFO    ] Running state [deb http://archive.canonical.com/ubuntu/ trusty partner] at time 15:03:14.008331
[INFO    ] Executing state pkgrepo.managed for deb http://archive.canonical.com/ubuntu/ trusty partner
[INFO    ] Executing command 'apt-get -q update' in directory '/home/carmstrong'
[INFO    ] {'repo': 'deb http://archive.canonical.com/ubuntu trusty partner'}
[INFO    ] Completed state [deb http://archive.canonical.com/ubuntu/ trusty partner] at time 15:03:16.996167
local:
    ----------
    pkgrepo_|-partner_|-deb http://archive.canonical.com/ubuntu/ trusty partner_|-managed:
        ----------
        __run_num__:
            0
        changes:
            ----------
            repo:
                deb http://archive.canonical.com/ubuntu trusty partner
        comment:
            Configured package repo 'deb http://archive.canonical.com/ubuntu/ trusty partner'
        duration:
            2987.836
        name:
            deb http://archive.canonical.com/ubuntu/ trusty partner
        result:
            True
        start_time:
            15:03:14.008331
$ cat /etc/apt/sources.list
# demo sources.list file
deb http://archive.canonical.com/ubuntu trusty partner

But if an entry already exists and is commented out, the state does nothing:

$ cat /etc/apt/sources.list
# demo sources.list file
# deb http://archive.canonical.com/ubuntu trusty partner
$ sudo salt-call state.high "{'partner': {'pkgrepo': ['managed', {'name': 'deb http://archive.canonical.com/ubuntu/ trusty partner'}, {'enabled': True}, {'file': '/etc/apt/sources.list'}]}}"
[INFO    ] Loading fresh modules for state activity
[INFO    ] Running state [deb http://archive.canonical.com/ubuntu/ trusty partner] at time 15:04:39.959589
[INFO    ] Executing state pkgrepo.managed for deb http://archive.canonical.com/ubuntu/ trusty partner
[INFO    ] Executing command 'apt-get -q update' in directory '/home/carmstrong'
[INFO    ] Configured package repo 'deb http://archive.canonical.com/ubuntu/ trusty partner'
[INFO    ] Completed state [deb http://archive.canonical.com/ubuntu/ trusty partner] at time 15:04:40.020455
local:
    ----------
    pkgrepo_|-partner_|-deb http://archive.canonical.com/ubuntu/ trusty partner_|-managed:
        ----------
        __run_num__:
            0
        changes:
            ----------
        comment:
            Configured package repo 'deb http://archive.canonical.com/ubuntu/ trusty partner'
        duration:
            60.866
        name:
            deb http://archive.canonical.com/ubuntu/ trusty partner
        result:
            True
        start_time:
            15:04:39.959589
$ cat /etc/apt/sources.list
# demo sources.list file
# deb http://archive.canonical.com/ubuntu trusty partner
@jfindlay jfindlay added State-Module Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around P4 Priority 4 Platform Relates to OS, containers, platform-based utilities like FS, system based apps labels Sep 11, 2015
@jfindlay jfindlay added this to the Approved milestone Sep 11, 2015
@jfindlay
Copy link
Contributor

@clinta, thanks for the report. This comment may help, although I haven't tested it in this case.

@stale
Copy link

stale bot commented Dec 29, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Dec 29, 2017
@stale stale bot closed this as completed Jan 5, 2018
@marmarek
Copy link
Contributor

consolidate: True does not solve the problem. It makes things even worse - selected sources.list get all the other entries removed (regardless of being comments or not). But the requested repository still remain commented out!

The issue is still present in salt 2018.3.2. Please reopen.

@marmarek
Copy link
Contributor

PR fixing this issue: #51720

marmarek added a commit to marmarek/salt that referenced this issue Feb 24, 2019
On plain Debian, enabled/disabled argument was ignored.

Fixes saltstack#27067
marmarek added a commit to marmarek/salt that referenced this issue Feb 24, 2019
For now cover only cases related to saltstack#27067
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 P4 Priority 4 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around stale State-Module
Projects
None yet
Development

No branches or pull requests

3 participants