-
Notifications
You must be signed in to change notification settings - Fork 193
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
(PE-14495) Remove pluginsync setting if upgrading to 1.4.x #101
Conversation
a1d1444
to
86457d1
Compare
|
||
# When upgrading to 1.4.x or later remove pluginsync | ||
if ($package_version == undef and $old_packages) or (versioncmp($package_version, '1.4.0') >= 0) { | ||
$removedSettings = $_removedSettings + ['pluginsync'] |
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 still want to guard this if the setting is already present.
86457d1
to
e8590ab
Compare
+1 |
Ran this thorough a 2015.3.2->2015.3.x upgrade and I'm getting:
|
$removedSettings = $_removedSettings | ||
} | ||
|
||
if $removedSettings { |
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 can't remember, are arrays truthy in puppet now? Perhaps we need to be checking !empty and not truth?
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.
Ah, yep. Tested with Puppet 4:
# test.pp
$array = []
if $array {
notify {'array is true':}
}else{
notify {'array is false':}
}
~ puppet apply test.pp
WARN: Unresolved specs during Gem::Specification.reset:
hiera (< 4, >= 2.0)
json_pure (>= 0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
Notice: Compiled catalog for brandonhighmbp.corp.puppetlabs.net in environment production in 0.04 seconds
Notice: array is true
Notice: /Stage[main]/Main/Notify[array is true]/message: defined 'message' as 'array is true'
Notice: Applied catalog in 0.01 seconds
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.
Although... the .each
won't iterate over an empty array.
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 assumed incorrectly there.
Update: I'm relying on [].each
doing nothing. The if
statement is probably not necessary now, because I make sure there's always at least an empty array.
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.
Yeah, we can probably remove the if. As for my comment about the .each
, I'm just trying to figure out where no implicit conversion of nil into String
is coming from.
56824b9
to
f1a6837
Compare
Ok, made updates. |
@MikaelSmith The puppet.conf dep is still causing issues:
|
Oh, that's interesting. |
f1a6837
to
0e33a7c
Compare
Apparently the file needs to be managed. Hopefully fixed by ensuring it's a file if not already managed. |
👍 agent_upgrade test passed with this change. |
No description provided.