aodh: Add config for alarm_history_time_to_live (bsc#1073703)#1655
aodh: Add config for alarm_history_time_to_live (bsc#1073703)#1655cinerama70 wants to merge 1 commit into
Conversation
|
|
||
| def downgrade(ta, td, a, d) | ||
| a.delete("alarm_history_ttl") | ||
| return a, d |
There was a problem hiding this comment.
Style/RedundantReturn: Redundant return detected. To return multiple values, use an array. (https://github.com/bbatsov/ruby-style-guide#no-explicit-return)
| return a, d | ||
| end | ||
|
|
||
| def downgrade(ta, td, a, d) |
There was a problem hiding this comment.
Naming/UncommunicativeMethodParamName: Method parameter must be at least 3 characters long.
| service = ServiceObject.new "fake-logger" | ||
| a["alarm_history_ttl"] = service.random_password | ||
| end | ||
| return a, d |
There was a problem hiding this comment.
Style/RedundantReturn: Redundant return detected. To return multiple values, use an array. (https://github.com/bbatsov/ruby-style-guide#no-explicit-return)
| @@ -0,0 +1,12 @@ | |||
| def upgrade(ta, td, a, d) | |||
There was a problem hiding this comment.
Naming/UncommunicativeMethodParamName: Method parameter must be at least 3 characters long.
|
|
||
| def downgrade(ta, td, a, d) | ||
| a.delete("alarm_history_ttl") | ||
| return a, d |
There was a problem hiding this comment.
Style/RedundantReturn: Redundant return detected. To return multiple values, use an array. (https://github.com/bbatsov/ruby-style-guide#no-explicit-return)
| return a, d | ||
| end | ||
|
|
||
| def downgrade(ta, td, a, d) |
There was a problem hiding this comment.
Naming/UncommunicativeMethodParamName: Method parameter must be at least 3 characters long.
| service = ServiceObject.new "fake-logger" | ||
| a["alarm_history_ttl"] = service.random_password | ||
| end | ||
| return a, d |
There was a problem hiding this comment.
Style/RedundantReturn: Redundant return detected. To return multiple values, use an array. (https://github.com/bbatsov/ruby-style-guide#no-explicit-return)
| @@ -0,0 +1,12 @@ | |||
| def upgrade(ta, td, a, d) | |||
There was a problem hiding this comment.
Naming/UncommunicativeMethodParamName: Method parameter must be at least 3 characters long.
toabctl
left a comment
There was a problem hiding this comment.
Beside the inline comment, you need to bump the schema-revision in chef/data_bags/crowbar/template-aodh.json
| def upgrade(ta, td, a, d) | ||
| if a["alarm_history_ttl"].nil? || a["alarm_history_ttl"].empty? | ||
| service = ServiceObject.new "fake-logger" | ||
| a["alarm_history_ttl"] = service.random_password |
There was a problem hiding this comment.
A random password looks wrong. Also the if and service = lines are not needed. I think you want a["alarm_history_ttl"] = ta["alarm_history_ttl"] which will set the default value
|
@cinerama70 looks like you are not in the needed github group so no CI run will be triggered. @jdsn are you able fix that? |
| @@ -0,0 +1,12 @@ | |||
| def upgrade(ta, td, a, d) | |||
| if a["alarm_history_ttl"].nil? || a["alarm_history_ttl"].empty? | |||
| service = ServiceObject.new "fake-logger" | |||
There was a problem hiding this comment.
Lint/UselessAssignment: Useless assignment to variable - service. (https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars)
The alarm_history_time_to_live config option for aodh was not previously configurable.
| return a, d | ||
| end | ||
|
|
||
| def downgrade(ta, td, a, d) |
There was a problem hiding this comment.
Naming/UncommunicativeMethodParamName: Method parameter must be at least 3 characters long.
| @@ -0,0 +1,12 @@ | |||
| def upgrade(ta, td, a, d) | |||
| if a["alarm_history_ttl"].nil? || a["alarm_history_ttl"].empty? | |||
| service = ServiceObject.new "fake-logger" | |||
There was a problem hiding this comment.
Lint/UselessAssignment: Useless assignment to variable - service. (https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars)
| @@ -0,0 +1,12 @@ | |||
| def upgrade(ta, td, a, d) | |||
There was a problem hiding this comment.
Naming/UncommunicativeMethodParamName: Method parameter must be at least 3 characters long.
|
I've added (invited) @cinerama70 to the Crowbar Org as well as the SUSE team. That should do the trick, please let me know if there's anything else. |
| @@ -0,0 +1,12 @@ | |||
| def upgrade(ta, td, a, d) | |||
| if a["alarm_history_ttl"].nil? || a["alarm_history_ttl"].empty? | |||
There was a problem hiding this comment.
I think you want:
unless a.key? "alarm_history_ttl"
a["alarm_history_ttl"] = ta["alarm_history_ttl"]
end
This is useful if we backport this change and later somebody upgrade from SOC7 to SOCC8
| @@ -0,0 +1,12 @@ | |||
| def upgrade(ta, td, a, d) | |||
| if a["alarm_history_ttl"].nil? || a["alarm_history_ttl"].empty? | |||
| service = ServiceObject.new "fake-logger" | |||
| end | ||
|
|
||
| def downgrade(ta, td, a, d) | ||
| a.delete("alarm_history_ttl") |
There was a problem hiding this comment.
And then here:
unless ta.key? "alarm_history_ttl""
a.delete("alarm_history_ttl"")
end
|
I close this one in favor of #1674 |
The alarm_history_time_to_live config option for aodh
was not previously configurable.