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

(MODULES-10357) Fix proxy => absent #24

Merged
merged 1 commit into from
Dec 19, 2019

Conversation

alexjfisher
Copy link
Contributor

The provider is expecting absent to be a symbol.

From https://puppet.com/docs/puppet/latest/custom_types.html

The default munge method converts any values that are specifically
allowed into symbols. If you override either of these methods, note that
you lose this value handling and symbol conversion, which you’ll have to
call super for.

@alexjfisher alexjfisher requested a review from a team December 19, 2019 12:02
@alexjfisher alexjfisher changed the title (MODULES-10357) Fix proxy => absent WIP: (MODULES-10357) Fix proxy => absent Dec 19, 2019
@gimmyxd gimmyxd requested a review from a team December 19, 2019 12:14
@alexjfisher
Copy link
Contributor Author

I've marked it WIP whilst I investigate whether I can easily extend the acceptance testing to cover proxy => '_none_'

The provider is expecting `absent` to be a symbol.

From https://puppet.com/docs/puppet/latest/custom_types.html

> The default munge method converts any values that are specifically
allowed into symbols. If you override either of these methods, note that
you lose this value handling and symbol conversion, which you’ll have to
call super for.
apply_manifest(pp, catch_changes: true)
end

if fact('os.release.major') == '8'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As much as I can be, I think this test should execute correctly. beaker-rspec doesn't appear to support EL8 though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

NameError:
uninitialized constant Beaker::HostPrebuiltSteps::RHEL8_PACKAGES
Did you mean? Beaker::HostPrebuiltSteps::SLES_PACKAGES

Copy link
Contributor

@gimmyxd gimmyxd Dec 19, 2019

Choose a reason for hiding this comment

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

Seems like this module is still on beaker 3.
RHEL8_PACKAGES were added in beaker 4

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good spot. I've tweaking the Gemfile and spec helper locally, and the tests do run on EL8. Probably not much point me committing any of these changes though as you'll prefer to migrate to litmus? (and if the tests could run in travis, that'd be helpful too).

Copy link
Contributor

Choose a reason for hiding this comment

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

This test is currently failing on Fedora.
Can you please change the condition from ==8 to >=8.

More info about this in the conversation of this PR: https://github.com/puppetlabs/puppetlabs-yumrepo_core/pull/22/files#diff-dc408e2d28dac43c3fdd4c2012e8d74bR314

@@ -4,12 +4,11 @@

$LOAD_PATH << File.join(__dir__, 'acceptance/lib')

run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was necessary to move this out of the Rspec.configure block below. Otherwise, facter isn't available when if fact('os.release.major') == '8' runs.

@alexjfisher
Copy link
Contributor Author

PR updated to test proxy => '_none_'

@alexjfisher alexjfisher changed the title WIP: (MODULES-10357) Fix proxy => absent (MODULES-10357) Fix proxy => absent Dec 19, 2019
@@ -321,7 +321,7 @@

munge do |value|
return '' if Facter.value(:operatingsystemmajrelease).to_i >= 8 && value.to_s == '_none_'
value.to_s
super(value)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The docs suggest super instead of super(value). They need updating though?
Otherwise you get

Munging failed for value "http://proxy.example.com:3128" in class proxy: implicit argument passing of super from method defined by define_method() is not supported. Specify all arguments explicitly.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the heads-up, We'll create a docs ticket for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I already left feedback on the page, so I guess a ticket should magic into existence anyway?

Copy link

Choose a reason for hiding this comment

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

Docs fixed! Thanks. 😄

Copy link
Contributor

@gimmyxd gimmyxd left a comment

Choose a reason for hiding this comment

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

👍 Test are also passing on el-8

@gimmyxd gimmyxd merged commit fdc028b into puppetlabs:master Dec 19, 2019
@gimmyxd gimmyxd added the bug Something isn't working label Dec 19, 2019
@alexjfisher alexjfisher deleted the MODULES_10357 branch December 19, 2019 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants