-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add root and no_recommends parameters in the public interface for Zypper and RPM (lowpkg) #50125
Conversation
dd171d3
to
4b1ba30
Compare
Rebased |
d5528a0
to
e9e2320
Compare
c0905e9
to
a053f9c
Compare
@isbm ready for a deeper review! |
@aplanas There are some tests failing with this change. Can you take a look? https://jenkinsci.saltstack.com/job/pr-kitchen-centos7-py2/job/PR-50125/12/ |
@rallytime indeed, thanks |
ae8895f
to
54d46b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aplanas OK, I stopped, but there are more. Please first fix these. 😉
@isbm I am done with the 'in's. Thanks! |
cb8b670
to
6722b49
Compare
# Ignore exit code for 106 (repo is not available) | ||
if 'no_repo_failure' in kwargs: | ||
self.__ignore_repo_failure = kwargs['no_repo_failure'] | ||
if 'systemd_scope' in kwargs: | ||
self.__systemd_scope = kwargs['systemd_scope'] | ||
if 'root' in kwargs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if kwargs.get('root'):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a second though, are you sure? This check if to assign self.__root later in the same fashion that 'no_repo_failure' and 'systemd_scope'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, OK, copypaste. Maybe let's to as is. But I still think the other parts also needs to be type-safe.
@isbm any more reviews? Any thing that I can do? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aplanas nope, good to go. 😉
The CLI rpm command allows the --root parameter to change the expected location where the rpm database can be found. This patch add a new optional parameter in the public interface to allow the set of the new root location. Update the tests to use the extra parameter.
The zypper CLI provides a way to change the path where zypper expect to find the required configuration files and repositories. This feature is useful to bootstrap chroot environments, inspect repositories and packages from locally mounted devices, or help during the installation of a new OS from the SUSE family. This patch add the root optional parameter for each command in the public interface, and fix the tests.
_Zypper class take note when a .call() is done, to clean up the data when we access to some attribute. This produces a bug when two calls are one after another an we set some attributes via the __call__ method, as whatever is set will be cleared after the first attribute is accessed. For example: zypper.attrib.call(..) zypper(root=root).otherattrib.call(..) The first call will set __called as True, and the reset of the inner state of zypper will be cleared when otherattrib is accessed, cleanning the status for __root. This patch makes sure to clean the status also during the __call__ method, avoiding the cleanning when the attribute is accessed.
Add no_recommends parameter to install and upgrade actions.
This PR is reaching the 1 month old mark. If there anything that I can do the help here? The code do not change the default behavior, as I did not change the semantic of the tests. |
@terminalmage and @meaksh How does this look to you now? |
thanks a lot for the reviews! |
* Add root and no_recommends parameters in the public interface for Zypper and RPM (lowpkg) saltstack/salt#50125 * Add root parameter to useradd, shadow and groupadd saltstack/salt#50175 * cmd: Add root parameter for wait and run states saltstack/salt#50302 * systemd: add optional root parameter saltstack/salt#50380 * Add new chroot module https://github.com/openSUSE/salt/pull/50418 * Add new module freezer saltstack/salt#50452 * btrfs: add all subvolume commands saltstack/salt#50541 * btrfs: add new btrfs state saltstack/salt#50635 * zypper: demote log from error to warning saltstack/salt#50671 * blkid: add search by token saltstack/salt#50706 * mount: add fstab_{present,absent} states saltstack/salt#50725 * btrfs: add option to not set subvolumes as default https://github.com/openSUSE/salt/pull/50801 * Add disk_set and disk_toggle functions, and update valid partition flags https://github.com/openSUSE/salt/pull/50834 * disk: support setting FAT size for format_ https://github.com/openSUSE/salt/pull/51074 * parted: fix set_ valid flags comment. https://github.com/openSUSE/salt/pull/51704 * grains/core: ignore HOST_NOT_FOUND errno in fqdns() https://github.com/openSUSE/salt/pull/51706 * cmdmod: add 'binds' parameter in run_chroot https://github.com/openSUSE/salt/pull/51871 * mount: fix extra -t parameter https://github.com/openSUSE/salt/pull/51905 * lvm: be quiet when a pv, lv or vg is not expected https://github.com/openSUSE/salt/pull/51929 * linux_lvm: clean error in pvcreate and pvremove https://github.com/openSUSE/salt/pull/51954 * blockdev: hide blkid errors when are expected https://github.com/openSUSE/salt/pull/51956 * partially unify public functions signature for pkg and lowpkg https://github.com/openSUSE/salt/pull/51973 * extmods: add utils directories in sys.path https://github.com/openSUSE/salt/pull/52001
* Add root and no_recommends parameters in the public interface for Zypper and RPM (lowpkg) saltstack/salt#50125 * Add root parameter to useradd, shadow and groupadd saltstack/salt#50175 * cmd: Add root parameter for wait and run states saltstack/salt#50302 * systemd: add optional root parameter saltstack/salt#50380 * Add new chroot module https://github.com/openSUSE/salt/pull/50418 * Add new module freezer saltstack/salt#50452 * btrfs: add all subvolume commands saltstack/salt#50541 * btrfs: add new btrfs state saltstack/salt#50635 * zypper: demote log from error to warning saltstack/salt#50671 * blkid: add search by token saltstack/salt#50706 * mount: add fstab_{present,absent} states saltstack/salt#50725 * btrfs: add option to not set subvolumes as default saltstack/salt#50801 * Add disk_set and disk_toggle functions, and update valid partition flags saltstack/salt#50834 * disk: support setting FAT size for format_ saltstack/salt#51074 * parted: fix set_ valid flags comment. saltstack/salt#51704 * grains/core: ignore HOST_NOT_FOUND errno in fqdns() saltstack/salt#51706 * cmdmod: add 'binds' parameter in run_chroot saltstack/salt#51871 * mount: fix extra -t parameter saltstack/salt#51905 * lvm: be quiet when a pv, lv or vg is not expected saltstack/salt#51929 * linux_lvm: clean error in pvcreate and pvremove saltstack/salt#51954 * blockdev: hide blkid errors when are expected saltstack/salt#51956 * partially unify public functions signature for pkg and lowpkg saltstack/salt#51973 * extmods: add utils directories in sys.path saltstack/salt#52001
* Add root and no_recommends parameters in the public interface for Zypper and RPM (lowpkg) saltstack/salt#50125 * Add root parameter to useradd, shadow and groupadd saltstack/salt#50175 * cmd: Add root parameter for wait and run states saltstack/salt#50302 * systemd: add optional root parameter saltstack/salt#50380 * Add new chroot module https://github.com/openSUSE/salt/pull/50418 * Add new module freezer saltstack/salt#50452 * btrfs: add all subvolume commands saltstack/salt#50541 * btrfs: add new btrfs state saltstack/salt#50635 * zypper: demote log from error to warning saltstack/salt#50671 * blkid: add search by token saltstack/salt#50706 * mount: add fstab_{present,absent} states saltstack/salt#50725 * btrfs: add option to not set subvolumes as default saltstack/salt#50801 * Add disk_set and disk_toggle functions, and update valid partition flags saltstack/salt#50834 * disk: support setting FAT size for format_ saltstack/salt#51074 * parted: fix set_ valid flags comment. saltstack/salt#51704 * grains/core: ignore HOST_NOT_FOUND errno in fqdns() saltstack/salt#51706 * cmdmod: add 'binds' parameter in run_chroot saltstack/salt#51871 * mount: fix extra -t parameter saltstack/salt#51905 * lvm: be quiet when a pv, lv or vg is not expected saltstack/salt#51929 * linux_lvm: clean error in pvcreate and pvremove saltstack/salt#51954 * blockdev: hide blkid errors when are expected saltstack/salt#51956 * partially unify public functions signature for pkg and lowpkg saltstack/salt#51973 * extmods: add utils directories in sys.path saltstack/salt#52001
What does this PR do?
Provides a new root parameter in the public interfaces for rpm and zypper
What issues does this PR fix or reference?
New feature
Tests written?
For the low level RPM yes, for the zypper level I adjusted the current tests.