Skip to content

aodh: Add config for alarm_history_time_to_live (bsc#1073703)#1655

Closed
cinerama70 wants to merge 1 commit into
crowbar:masterfrom
cinerama70:bz1073703
Closed

aodh: Add config for alarm_history_time_to_live (bsc#1073703)#1655
cinerama70 wants to merge 1 commit into
crowbar:masterfrom
cinerama70:bz1073703

Conversation

@cinerama70

Copy link
Copy Markdown
Contributor

The alarm_history_time_to_live config option for aodh
was not previously configurable.


def downgrade(ta, td, a, d)
a.delete("alarm_history_ttl")
return a, d

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Naming/UncommunicativeMethodParamName: Method parameter must be at least 3 characters long.

@toabctl toabctl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Beside the inline comment, you need to bump the schema-revision in chef/data_bags/crowbar/template-aodh.json

Comment thread 202_add_alarm_history_ttl.rb Outdated
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@toabctl

toabctl commented May 3, 2018

Copy link
Copy Markdown
Contributor

@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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Naming/UncommunicativeMethodParamName: Method parameter must be at least 3 characters long.

@rsimai

rsimai commented May 8, 2018

Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not needed

end

def downgrade(ta, td, a, d)
a.delete("alarm_history_ttl")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

And then here:

  unless ta.key? "alarm_history_ttl""
    a.delete("alarm_history_ttl"")
  end

@aplanas

aplanas commented May 28, 2018

Copy link
Copy Markdown
Contributor

I close this one in favor of #1674

@aplanas aplanas closed this May 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants