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

Move Openstack refresher settings #91

Merged
merged 1 commit into from
Oct 23, 2017

Conversation

mansam
Copy link
Contributor

@mansam mansam commented Oct 11, 2017

No description provided.

@miq-bot miq-bot added the wip label Oct 11, 2017
@mansam mansam force-pushed the move-openstack-refresher-settings branch from 2fbcc99 to 2ff0b63 Compare October 11, 2017 18:28
@miq-bot
Copy link
Member

miq-bot commented Oct 11, 2017

Checked commit mansam@2ff0b63 with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks fine. 👍

@mansam mansam changed the title [WIP] Move Openstack refresher settings Move Openstack refresher settings Oct 17, 2017
@miq-bot miq-bot removed the wip label Oct 17, 2017

def up
say_with_time('Move Openstack provider refresher settings') do
SettingsChange.where(:key => '/ems/ems_openstack/refresh/inventory_object_refresh').update(:key => '/ems/ems_refresh/openstack/inventory_object_refresh')
Copy link
Member

@Fryguy Fryguy Oct 20, 2017

Choose a reason for hiding this comment

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

Prefer update_all over update as it will go direct to the DB instead of instantiating one-by-one.

Doesn't matter since you search for a single key. However, if the entirety of "/ems/ems_openstack/refresh" is changing you can also do:

SettingsChange.where("key LIKE ?", "/ems/ems_openstack/refresh/%"').each do |sc|
  sc.update_attributes!(:key => sc.key.sub("/ems/ems_openstack/refresh/", "/ems/ems_refresh/openstack")
end

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool. The changes aren't all exactly 1-1 so I'm going to stick with the explicit calls, if that's alright with you.

@Fryguy Fryguy merged commit 4fa6cf1 into ManageIQ:master Oct 23, 2017
@Fryguy Fryguy added this to the Sprint 72 Ending Oct 30, 2017 milestone Oct 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants