-
-
Notifications
You must be signed in to change notification settings - Fork 500
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
Refactor rabbitmq_user provider (mpolenchuk) #598
Conversation
a3e3f98
to
96bd913
Compare
80e8fda
to
bcd0294
Compare
4a2a470
to
5f91749
Compare
@ekohl @hunner I think this is ready for review, and would very much appreciate a review on this one if at all possible. In particular, I think the tests could use some improvement, especially for the change password situation. However, at a functional level, I think this is working(ish), and an improvement. |
5f91749
to
b1a2b85
Compare
end | ||
|
||
it do | ||
provider.check_password('secret') |
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.
I don't think this is doing anything useful, but need to come up with a better test here.
@mpolenchuk - don't know if you've got time to review, but let me know if this looks sane. I'm still trying to come up with a better test case for the password change bit. |
|
||
def should_to_s(_newvalue = @should) | ||
'<new password>' | ||
end | ||
end | ||
|
||
newproperty(:admin) 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.
You can use newproperty(:admin, boolean: true, parent: Parent::Property::Boolean)
and remove the body (except desc
). Then you can use true booleans in the provider. You might need a require 'puppet/property/boolean
but I'm not sure about that.
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.
I think this is a good idea, but I feel like it should be implemented separately, and then we can review all the type parameters at once, and adjust any that we can switch to true booleans / integers / etc in one 'breaking' changeset.
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.
That's fair
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.
It seems like the existing code is (in some cases) as simple as:
newparam(:force) do
defaultto(:false)
newvalues(:true, :false)
end
which actually seems simpler than the suggested code in https://docs.puppet.com/puppet/5.1/custom_types.html, and without that extra require
. Also, the puppet boolean type allows 'true'
yes
, and various other things, which seems kind of regressive.
e231bcf
to
aa01efd
Compare
Changes Unknown when pulling e6407e2 on wyardley:rework_pull_460 into ** on voxpupuli:master**. |
2 similar comments
Changes Unknown when pulling e6407e2 on wyardley:rework_pull_460 into ** on voxpupuli:master**. |
Changes Unknown when pulling e6407e2 on wyardley:rework_pull_460 into ** on voxpupuli:master**. |
2 similar comments
1 similar comment
fe41806
to
50358fc
Compare
@ekohl: the shared example seems to get executed after the other elements in the block, which is causing an ordering issue.
results in
It's failing because the test for the user being gone runs before the shared example runs. |
50358fc
to
6974325
Compare
6974325
to
e3730f6
Compare
1 similar comment
Refactor rabbitmq_user provider (mpolenchuk)
Refactor rabbitmq_user provider (mpolenchuk)
Refactor rabbitmq_user provider (mpolenchuk)
This is an attempt to rework #460 by @mpolenchuk (keeping original attribution).
Could use careful review, rebasing was pretty hairy, and not sure I got everything.
As of now, failing at least one test.