Affects Version/s: PUP 4.4.1
Fix Version/s: PUP 4.9.0
Verify exclusive open fails before applying the change. Verify passes after change. Double-check Forge for modules that make calls to filesystem methods and notify authors if they are using filesystem methods that will be not be backwards compatible with our changes. Validate whether PUP-1583 is fixed by this.
- Verify exclusive open fails before applying the change.
- Verify passes after change.
- Double-check Forge for modules that make calls to filesystem methods and notify authors if they are using filesystem methods that will be not be backwards compatible with our changes.
- Validate whether
PUP-1583is fixed by this.
Sprint:AP 2016-10-19, AP 2016-11-02, AP 2016-11-16, AP 2016-11-30, AP 2016-12-14
Release Notes:Not Needed
QA Risk Assessment:No Action
QA Risk Assessment Reason:N/A [mass update]: Various build, documentation, infra, or test-related issues
The current FileSystem.open implementation is a bit peculiar at https://github.com/puppetlabs/puppet/blob/master/lib/puppet/file_system/file_impl.rb#L30-L32:
The signature of the underlying Ruby method is open(filename [, mode [, perm]] [, opt], &block) - which means that we have shuffled and renamed some of Rubys parameters:
- Rubys perm in our call is renamed as mode, and is moved from position 2 to position 1
- Rubys mode in our call is renamed as options, and is moved from position 1 to position 2
- We don't support the passing in of Rubys opt which is where one would set :encoding => 'utf-8'
Fortunately there are only a few callsites which use FileSystem.open that are currently impacted:
- directory_setting.rb - https://github.com/puppetlabs/puppet/blob/e99b2ae79225293763bbb4eeba39e75920dd0d80/lib/puppet/settings/directory_setting.rb#L9
- file_or_directory_setting.rb - https://github.com/puppetlabs/puppet/blob/e99b2ae79225293763bbb4eeba39e75920dd0d80/lib/puppet/settings/file_or_directory_setting.rb#L30
- file_setting.rb - https://github.com/puppetlabs/puppet/blob/e99b2ae79225293763bbb4eeba39e75920dd0d80/lib/puppet/settings/file_setting.rb#L190-L197
- face/config.rb - https://github.com/puppetlabs/puppet/blob/e99b2ae79225293763bbb4eeba39e75920dd0d80/lib/puppet/face/config.rb#L111
- file_bucket/file.rb - https://github.com/puppetlabs/puppet/blob/e99b2ae79225293763bbb4eeba39e75920dd0d80/lib/puppet/file_bucket/file.rb#L128
- indirector/file_bucket_file/file.rb - https://github.com/puppetlabs/puppet/blob/e99b2ae79225293763bbb4eeba39e75920dd0d80/lib/puppet/indirector/file_bucket_file/file.rb#L118 - multiple hits here
Note that both the calls to FileSystem.open and FileSystem.exclusive_open are impacted.
At the time this PR goes up, another scan should occur to make sure that all callsites are corrected.