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

btrfs: add option to not set subvolumes as default #50801

Merged
merged 1 commit into from
Dec 10, 2018

Conversation

aplanas
Copy link
Contributor

@aplanas aplanas commented Dec 10, 2018

What does this PR do?

When we want to create a subvolume and set is as default, we can
use the set_default parameter. The current code will check, for
already created subvolumes, if it is actually marked as default,
and if not it will be set inside the state.

For composability with other states, we sometimes want to avoid
the re-set of the default flag for already present subvolumes, as
can be that this was change in a later action by another state.

Tests written?

Yes

@ghost ghost self-requested a review December 10, 2018 09:27
Copy link
Contributor

@isbm isbm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a very little moment: to avoid nested if. Other then that, looks good.

salt/states/btrfs.py Outdated Show resolved Hide resolved
When we want to create a subvolume and set is as default, we can
use the set_default parameter. The current code will check, for
already created subvolumes, if it is actually marked as default,
and if not it will be set inside the state.

For composability with other states, we sometimes want to avoid
the re-set of the default flag for already present subvolumes, as
can be that this was change in a later action by another state.
@cachedout cachedout merged commit e555a67 into saltstack:develop Dec 10, 2018
@aplanas aplanas deleted the fix_btrfs branch December 11, 2018 09:07
aplanas added a commit to aplanas/salt-1 that referenced this pull request Jan 30, 2019
* blockdev: fix url from comment
saltstack/salt#49668

* Documentation: fix typo in "equivalent"
saltstack/salt#49669

* states_pt3: fix rST link format
saltstack/salt#49670

* parted: fix _validate_partition_boundary
saltstack/salt#49803

* parted: fix the ordering of list command
saltstack/salt#49804

* Fix lowpkg.diff documentation and parameter name
saltstack/salt#50126

* 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

* service: SUSE is not based on sysvinit anymore
saltstack/salt#50396

* Add new chroot module
saltstack/salt#50418

* Add new module freezer
saltstack/salt#50452

* parted: support variable length output for print
saltstack/salt#50473

* btrfs: add all subvolume commands
saltstack/salt#50541

* file: update attributes for lsattr and chattr
saltstack/salt#50607

* 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

* cmdmod: add sysfs into the chroot
saltstack/salt#51094

* mount: cache blkid information
saltstack/salt#51135
aplanas added a commit to aplanas/salt-1 that referenced this pull request Feb 4, 2019
* blockdev: fix url from comment
saltstack/salt#49668

* Documentation: fix typo in "equivalent"
saltstack/salt#49669

* states_pt3: fix rST link format
saltstack/salt#49670

* parted: fix _validate_partition_boundary
saltstack/salt#49803

* parted: fix the ordering of list command
saltstack/salt#49804

* Fix lowpkg.diff documentation and parameter name
saltstack/salt#50126

* 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

* service: SUSE is not based on sysvinit anymore
saltstack/salt#50396

* Add new chroot module
saltstack/salt#50418

* Add new module freezer
saltstack/salt#50452

* parted: support variable length output for print
saltstack/salt#50473

* btrfs: add all subvolume commands
saltstack/salt#50541

* file: update attributes for lsattr and chattr
saltstack/salt#50607

* 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

* cmdmod: add sysfs into the chroot
saltstack/salt#51094

* mount: cache blkid information
saltstack/salt#51135
aplanas added a commit to aplanas/salt-1 that referenced this pull request Feb 4, 2019
* blockdev: fix url from comment
saltstack/salt#49668

* Documentation: fix typo in "equivalent"
saltstack/salt#49669

* states_pt3: fix rST link format
saltstack/salt#49670

* parted: fix _validate_partition_boundary
saltstack/salt#49803

* parted: fix the ordering of list command
saltstack/salt#49804

* Fix lowpkg.diff documentation and parameter name
saltstack/salt#50126

* 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

* service: SUSE is not based on sysvinit anymore
saltstack/salt#50396

* Add new chroot module
saltstack/salt#50418

* Add new module freezer
saltstack/salt#50452

* parted: support variable length output for print
saltstack/salt#50473

* btrfs: add all subvolume commands
saltstack/salt#50541

* file: update attributes for lsattr and chattr
saltstack/salt#50607

* 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

* cmdmod: add sysfs into the chroot
saltstack/salt#51094

* mount: cache blkid information
saltstack/salt#51135
aplanas added a commit to aplanas/salt-1 that referenced this pull request Feb 4, 2019
* blockdev: fix url from comment
saltstack/salt#49668

* Documentation: fix typo in "equivalent"
saltstack/salt#49669

* states_pt3: fix rST link format
saltstack/salt#49670

* parted: fix _validate_partition_boundary
saltstack/salt#49803

* parted: fix the ordering of list command
saltstack/salt#49804

* Fix lowpkg.diff documentation and parameter name
saltstack/salt#50126

* 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

* service: SUSE is not based on sysvinit anymore
saltstack/salt#50396

* Add new chroot module
saltstack/salt#50418

* Add new module freezer
saltstack/salt#50452

* parted: support variable length output for print
saltstack/salt#50473

* btrfs: add all subvolume commands
saltstack/salt#50541

* file: update attributes for lsattr and chattr
saltstack/salt#50607

* 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

* cmdmod: add sysfs into the chroot
saltstack/salt#51094

* mount: cache blkid information
saltstack/salt#51135
aplanas added a commit to aplanas/salt-1 that referenced this pull request Feb 26, 2019
* blockdev: fix url from comment
saltstack/salt#49668

* Documentation: fix typo in "equivalent"
saltstack/salt#49669

* states_pt3: fix rST link format
saltstack/salt#49670

* parted: fix _validate_partition_boundary
saltstack/salt#49803

* parted: fix the ordering of list command
saltstack/salt#49804

* Fix lowpkg.diff documentation and parameter name
saltstack/salt#50126

* 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

* service: SUSE is not based on sysvinit anymore
saltstack/salt#50396

* Add new chroot module
saltstack/salt#50418

* Add new module freezer
saltstack/salt#50452

* parted: support variable length output for print
saltstack/salt#50473

* btrfs: add all subvolume commands
saltstack/salt#50541

* file: update attributes for lsattr and chattr
saltstack/salt#50607

* 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

* cmdmod: add sysfs into the chroot
saltstack/salt#51094

* mount: cache blkid information
saltstack/salt#51135
aplanas added a commit to aplanas/salt-1 that referenced this pull request Mar 6, 2019
* 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
aplanas added a commit to aplanas/salt-1 that referenced this pull request Jun 5, 2019
* 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
@waynew waynew added this to PR needs port to master in PRs to port to master Oct 24, 2019
@Ch3LL Ch3LL moved this from PR needs port to master to PR has port to master in PRs to port to master Apr 22, 2020
@Ch3LL Ch3LL added the has master-port port to master has been created label Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has master-port port to master has been created
Projects
No open projects
PRs to port to master
  
PR has port to master
Development

Successfully merging this pull request may close these issues.

None yet

4 participants