Skip to content

archive.extracted: Use user/group, not archive_user#36552

Merged
cachedout merged 1 commit intosaltstack:developfrom
aneeshusa:finalize-archive_user-removal-in-archive.extracted
Sep 26, 2016
Merged

archive.extracted: Use user/group, not archive_user#36552
cachedout merged 1 commit intosaltstack:developfrom
aneeshusa:finalize-archive_user-removal-in-archive.extracted

Conversation

@aneeshusa
Copy link
Copy Markdown
Contributor

@aneeshusa aneeshusa commented Sep 24, 2016

What does this PR do?

Ensure that any created parent directories are made with user/group
perms, not as the archive_user user. This also allows setting the
group for these dirs instead of defaulting to root.

The archive_user argument to archive.extracted has been deprecated
since version 2014.7.2, and supplanted by the user parameter in
2015.8.0, with a logged warning until Boron. Now that 2016.3.0 is out,
complete the deprecation by:

  • no longer silently using archive_user in archive.extracted,
    preferring instead user and group,
  • no longer accepted archive_user as an argument.

Also update man page.

What issues does this PR fix or reference?

Hit this during servo/saltfs#483 when upgrading from 2015.5.8 to 2016.3.3.

Previous Behavior

Use the (deprecated) archive_user argument when making parent directories.

New Behavior

Use the user and group arguments to set permissions on created parent directories.

Tests written?

No

Please review Salt's Contributing Guide for best practices.

@aneeshusa
Copy link
Copy Markdown
Contributor Author

I would also appreciate this being cherry-picked to 16.03.

@aneeshusa aneeshusa force-pushed the finalize-archive_user-removal-in-archive.extracted branch from c5d73da to ba8650c Compare September 24, 2016 03:38
@aneeshusa aneeshusa changed the title archive.extracted: Use user, not old archive_user archive.extracted: Use user/group, not archive_user Sep 24, 2016
Ensure that any created parent directories are made with `user`/`group`
perms, not as the `archive_user` user. This also allows setting the
group for these dirs instead of defaulting to `root`.

The `archive_user` argument to archive.extracted has been deprecated
since version 2014.7.2, and supplanted by the `user` parameter in
2015.8.0, with a logged warning until Boron. Now that 2016.3.0 is out,
complete the deprecation by:
- no longer silently using `archive_user` in `archive.extracted`,
  preferring instead `user` and `group`,
- no longer accepted `archive_user` as an argument.

Also update man page.
@aneeshusa aneeshusa force-pushed the finalize-archive_user-removal-in-archive.extracted branch from ba8650c to 4a9568d Compare September 24, 2016 03:42
aneeshusa added a commit to aneeshusa/servo-saltfs that referenced this pull request Sep 24, 2016
Homebrew recently changed their packaging of Salt and Python, using a
virtualenvs for Salt. Because we were pinning an old version of Salt,
but not the rest of Homebrew, this caused problems where pip was not
being resolved properly. Update Salt to the latest version to fix this.

As part of the update, also update some states to avoid deprecated
parameters in favor of newer ones:
- archive.extracted: archive_user -> user, group
- cmd.run: user, group -> runas

Note that due to saltstack/salt#36552,
`archive.extracted` states still have the archive_user argument to
ensure parent directories are made with the correct permissions.
aneeshusa added a commit to aneeshusa/servo-saltfs that referenced this pull request Sep 24, 2016
Homebrew recently changed their packaging of Salt and Python, using a
virtualenvs for Salt. Because we were pinning an old version of Salt,
but not the rest of Homebrew, this caused problems where pip was not
being resolved properly. Update Salt to the latest version to fix this.

As part of the update, also update some states to avoid deprecated
parameters in favor of newer ones:
- archive.extracted: archive_user -> user, group
- cmd.run: user, group -> runas

Note that due to saltstack/salt#36552,
`archive.extracted` states still have the archive_user argument to
ensure parent directories are made with the correct permissions.
aneeshusa added a commit to aneeshusa/servo-saltfs that referenced this pull request Sep 24, 2016
Homebrew recently changed their packaging of Salt and Python, using a
virtualenvs for Salt. Because we were pinning an old version of Salt,
but not the rest of Homebrew, this caused problems where pip was not
being resolved properly. Update Salt to the latest version to fix this.

As part of the update, also update some states to avoid deprecated
parameters in favor of newer ones:
- archive.extracted: archive_user -> user, group
- cmd.run: user, group -> runas

Note that due to saltstack/salt#36552,
`archive.extracted` states still have the archive_user argument to
ensure parent directories are made with the correct permissions.
@cachedout cachedout merged commit cf5c891 into saltstack:develop Sep 26, 2016
@cachedout cachedout added the bugfix-bckport will be be back-ported to an older release branch by creating a PR against that branch label Sep 26, 2016
aneeshusa added a commit to aneeshusa/servo-saltfs that referenced this pull request Sep 26, 2016
Homebrew recently changed their packaging of Salt and Python, using a
virtualenvs for Salt. Because we were pinning an old version of Salt,
but not the rest of Homebrew, this caused problems where pip was not
being resolved properly. Update Salt to the latest version to fix this.

As part of the update, also update some states to avoid deprecated
parameters in favor of newer ones:
- archive.extracted: archive_user -> user, group
- cmd.run: user, group -> runas

Note that due to saltstack/salt#36552,
`archive.extracted` states still have the archive_user argument to
ensure parent directories are made with the correct permissions.

saltfs-migration: Upgrade Salt on all machines. Steps:
- Stop all salt-master and salt-minion services. Because we're upgrading
  Salt by two major versions at once, there are no guarantees that the
  masters and minions with different versions will be able to
  communicate.
- Use the install script to re-install Salt on each machine, the master
  first then the minion.
- Restart the salt-master and salt-minion services; pay attention to the
  system logs in case of startup failure.
aneeshusa added a commit to aneeshusa/servo-saltfs that referenced this pull request Sep 26, 2016
Homebrew recently changed their packaging of Salt and Python, using a
virtualenvs for Salt. Because we were pinning an old version of Salt,
but not the rest of Homebrew, this caused problems where pip was not
being resolved properly. Update Salt to the latest version to fix this.

As part of the update, also update some states to avoid deprecated
parameters in favor of newer ones:
- archive.extracted: archive_user -> user, group
- cmd.run: user, group -> runas

Note that due to saltstack/salt#36552,
`archive.extracted` states still have the archive_user argument to
ensure parent directories are made with the correct permissions.

saltfs-migration: Upgrade Salt on all machines. Steps:
- Stop all salt-master and salt-minion services. Because we're upgrading
  Salt by two major versions at once, there are no guarantees that the
  masters and minions with different versions will be able to
  communicate.
- Use the install script to re-install Salt on each machine, the master
  first then the minion.
- Restart the salt-master and salt-minion services; pay attention to the
  system logs in case of startup failure.
- Do NOT run a highstate until all minions and masters have been updated
  to Salt 2016.3.0.
@rallytime rallytime added Bugfix - [Done] back-ported and removed bugfix-bckport will be be back-ported to an older release branch by creating a PR against that branch labels Sep 28, 2016
cachedout pushed a commit that referenced this pull request Sep 29, 2016
aneeshusa added a commit to aneeshusa/servo-saltfs that referenced this pull request Apr 20, 2017
The newer version of this module will prefer to use the unzip command
instead of the python zipfil module for unzipping.
This works around https://bugs.python.org/issue15795,
namely a bug where the zipfile module does not respect permissions.
This will fix our Android toolchain `archive.extracted` states.

Note that this version of the module does not include
saltstack/salt#36552,
so keep the `archive_user` argument to `archive.extracted` states.

`archive.extracted` sets ownership only on the `if_missing` path,
so ensure Salt sets ownership on all the extracted files by unsetting
`if_missing`, which (as a new feature) now defaults to `name`.
This now refers to the top level extracted directory,
so all extracted files will be properly owned by `servo/servo`,
which ensures we are able to run the `android` command as the `servo`
user to download the platform and build tools in the `cmd.run` state.
aneeshusa added a commit to aneeshusa/servo-saltfs that referenced this pull request Apr 20, 2017
The newer version of this module will prefer to use the unzip command
instead of the python zipfil module for unzipping.
This works around https://bugs.python.org/issue15795,
namely a bug where the zipfile module does not respect permissions.
This will fix our Android toolchain `archive.extracted` states.

Note that this version of the module does not include
saltstack/salt#36552,
so keep the `archive_user` argument to `archive.extracted` states.

`archive.extracted` sets ownership only on the `if_missing` path,
so ensure Salt sets ownership on all the extracted files by unsetting
`if_missing`, which (as a new feature) now defaults to `name`.
This now refers to the top level extracted directory,
so all extracted files will be properly owned by `servo/servo`,
which ensures we are able to run the `android` command as the `servo`
user to download the platform and build tools in the `cmd.run` state.

Because the `unzip` binary will be used to extract the zip files,
require the `android-dependencies` `pkg.installed` state from
`archive.extracted` states that extract zip archives
to ensure that the `unzip` binary is available.
aneeshusa added a commit to aneeshusa/servo-saltfs that referenced this pull request Apr 20, 2017
The newer version of this module will prefer to use the unzip command
instead of the python zipfile module for unzipping.
This works around https://bugs.python.org/issue15795,
namely a bug where the zipfile module does not respect permissions.
This will fix our Android toolchain `archive.extracted` states.

Note that this version of the module does not include
saltstack/salt#36552,
so keep the `archive_user` argument to `archive.extracted` states.

`archive.extracted` sets ownership only on the `if_missing` path,
so ensure Salt sets ownership on all the extracted files
by unsetting `if_missing`, which defaults to `name`.
This now refers to the top level extracted directory,
so all extracted files will be properly owned by `servo/servo`,
which ensures we are able to run the `android` command as the `servo`
user to download the platform and build tools in the `cmd.run` state.

Because the `unzip` binary will be used to extract the zip files,
require the `android-dependencies` `pkg.installed` state from
`archive.extracted` states that extract zip archives
to ensure that the `unzip` binary is available.
Coder206 pushed a commit to Coder206/saltfs that referenced this pull request Apr 22, 2017
Homebrew recently changed their packaging of Salt and Python, using a
virtualenvs for Salt. Because we were pinning an old version of Salt,
but not the rest of Homebrew, this caused problems where pip was not
being resolved properly. Update Salt to the latest version to fix this.

As part of the update, also update some states to avoid deprecated
parameters in favor of newer ones:
- archive.extracted: archive_user -> user, group
- cmd.run: user, group -> runas

Note that due to saltstack/salt#36552,
`archive.extracted` states still have the archive_user argument to
ensure parent directories are made with the correct permissions.

saltfs-migration: Upgrade Salt on all machines. Steps:
- Stop all salt-master and salt-minion services. Because we're upgrading
  Salt by two major versions at once, there are no guarantees that the
  masters and minions with different versions will be able to
  communicate.
- Use the install script to re-install Salt on each machine, the master
  first then the minion.
- Restart the salt-master and salt-minion services; pay attention to the
  system logs in case of startup failure.
- Do NOT run a highstate until all minions and masters have been updated
  to Salt 2016.3.0.
choudhary001 pushed a commit to choudhary001/saltfs that referenced this pull request May 27, 2017
The newer version of this module will prefer to use the unzip command
instead of the python zipfile module for unzipping.
This works around https://bugs.python.org/issue15795,
namely a bug where the zipfile module does not respect permissions.
This will fix our Android toolchain `archive.extracted` states.

Note that this version of the module does not include
saltstack/salt#36552,
so keep the `archive_user` argument to `archive.extracted` states.

`archive.extracted` sets ownership only on the `if_missing` path,
so ensure Salt sets ownership on all the extracted files
by unsetting `if_missing`, which defaults to `name`.
This now refers to the top level extracted directory,
so all extracted files will be properly owned by `servo/servo`,
which ensures we are able to run the `android` command as the `servo`
user to download the platform and build tools in the `cmd.run` state.

Because the `unzip` binary will be used to extract the zip files,
require the `android-dependencies` `pkg.installed` state from
`archive.extracted` states that extract zip archives
to ensure that the `unzip` binary is available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants