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

Adding new rake config tasks #15184

Closed
wants to merge 2 commits into from
Closed

Adding new rake config tasks #15184

wants to merge 2 commits into from

Conversation

rsevilla87
Copy link
Contributor

@rsevilla87 rsevilla87 commented May 22, 2017

Rake tasks able to:

  • list available appliance roles
  • List appliance active roles
  • Set appliance roles
  • Get appliance small config summary
  • Create zone
  • Modify zone
  • List appliances
  • List zones

Rake tasks able to:

- list available appliance roles
- List appliance active roles
- Set appliance roles
- Get appliance small config summary
- Create zone
- Modify zone
- List appliances
- List zones
@miq-bot
Copy link
Member

miq-bot commented May 22, 2017

Some comments on commits https://github.com/rsevilla87/manageiq-1/compare/2a68e622437cd0c648d80bc50d0e008318051d85~...c00e86612f6ba33ad2e8350258c9eb607900918c

lib/tasks/config.rake

  • ⚠️ - 10 - Detected puts. Remove all debugging statements.
  • ⚠️ - 100 - Detected puts. Remove all debugging statements.
  • ⚠️ - 109 - Detected puts. Remove all debugging statements.
  • ⚠️ - 11 - Detected puts. Remove all debugging statements.
  • ⚠️ - 12 - Detected puts. Remove all debugging statements.
  • ⚠️ - 13 - Detected puts. Remove all debugging statements.
  • ⚠️ - 14 - Detected puts. Remove all debugging statements.
  • ⚠️ - 15 - Detected puts. Remove all debugging statements.
  • ⚠️ - 20 - Detected puts. Remove all debugging statements.
  • ⚠️ - 26 - Detected puts. Remove all debugging statements.
  • ⚠️ - 28 - Detected puts. Remove all debugging statements.
  • ⚠️ - 46 - Detected puts. Remove all debugging statements.
  • ⚠️ - 53 - Detected puts. Remove all debugging statements.
  • ⚠️ - 54 - Detected puts. Remove all debugging statements.
  • ⚠️ - 55 - Detected puts. Remove all debugging statements.
  • ⚠️ - 56 - Detected puts. Remove all debugging statements.
  • ⚠️ - 57 - Detected puts. Remove all debugging statements.
  • ⚠️ - 58 - Detected puts. Remove all debugging statements.
  • ⚠️ - 68 - Detected puts. Remove all debugging statements.
  • ⚠️ - 7 - Detected puts. Remove all debugging statements.
  • ⚠️ - 8 - Detected puts. Remove all debugging statements.
  • ⚠️ - 89 - Detected puts. Remove all debugging statements.
  • ⚠️ - 9 - Detected puts. Remove all debugging statements.

@miq-bot
Copy link
Member

miq-bot commented May 22, 2017

Checked commits https://github.com/rsevilla87/manageiq-1/compare/2a68e622437cd0c648d80bc50d0e008318051d85~...c00e86612f6ba33ad2e8350258c9eb607900918c with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 5 offenses detected

lib/tasks/config.rake

Copy link
Contributor Author

@rsevilla87 rsevilla87 left a comment

Choose a reason for hiding this comment

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

Fix rubocop typos

end

desc "List appliance active roles"
task :list_active_roles => [:environment] do
Copy link
Member

Choose a reason for hiding this comment

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

Can you review #14107 and specifically rake evm:status_full? There's some overlap specifically in the active roles. Maybe you can enhance it to list all roles in the output.

if ENV['APPLIANCE_ID'].blank?
puts MiqServer.my_server.active_role_names.to_json
else
puts MiqServer.find(ENV['APPLIANCE_ID']).role.split(",").to_json
Copy link
Member

Choose a reason for hiding this comment

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

Is this needed? rake evm:status_full shows all server's active roles

end

desc "Set appliance roles"
task :set_roles => [:environment] do
Copy link
Member

Choose a reason for hiding this comment

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

What's the use case for using this rake task? Are you trying to automate something? Can you give more details?

puts "Region: #{MiqServer.my_server.region_description}"
puts "Zone ID: #{MiqServer.my_server.zone_id}"
puts "Zone: #{MiqServer.my_server.zone_description}"
puts "Active roles: #{MiqServer.my_server.active_role}"
Copy link
Member

Choose a reason for hiding this comment

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

I think some of this overlaps with rake evm:status_full and rake evm:status... what's missing from those?

task :create_zone => [:environment] do
begin
raise "You must specify zone name and zone description" if ENV['NAME'].blank? || ENV['DESCRIPTION'].blank?
zone = Zone.new({'name': ENV['NAME'], 'description': ENV['DESCRIPTION']})
Copy link
Member

Choose a reason for hiding this comment

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

What's the use case for this?

end

desc "Modify appliance zone"
task :modify_zone => [:environment] do
Copy link
Member

Choose a reason for hiding this comment

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

What's the use case for this? Also, it's unclear what modifications we're making... set_zone probably makes more sense... but again, I'm not sure what the purpose is for. Are you automating something?

task :list_appliances=> [:environment] do
arr = []
MiqServer.all.as_json.each do |s|
arr << s.slice("id", "name")
Copy link
Member

Choose a reason for hiding this comment

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

rake evm:status_full ? Maybe we can make that rake task limit what columns comes back?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants