From 7bd6a8d2fb2fb08389a7408a942584920837266e Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Fri, 23 Nov 2018 22:08:54 +0100 Subject: [PATCH] Adjust alignment for new rubocop version --- share/linters/.rubocop.yml | 3 ++ src/cli/oneacct | 8 ++--- src/cli/oneflow | 72 +++++++++++++++++++------------------- src/cli/oneflow-template | 72 +++++++++++++++++++------------------- src/cli/onehost | 22 ++++++------ src/cli/oneimage | 8 ++--- src/cli/onemarketapp | 8 ++--- src/cli/oneshowback | 10 +++--- src/cli/onetemplate | 8 ++--- src/cli/oneuser | 22 ++++++------ src/cli/onevcenter | 20 +++++------ src/cli/onevm | 28 +++++++-------- src/cli/onevmgroup | 8 ++--- src/cli/onevnet | 8 ++--- src/cli/onevrouter | 8 ++--- 15 files changed, 154 insertions(+), 151 deletions(-) diff --git a/share/linters/.rubocop.yml b/share/linters/.rubocop.yml index e61571053d..68d291e0bc 100644 --- a/share/linters/.rubocop.yml +++ b/share/linters/.rubocop.yml @@ -3,6 +3,9 @@ # Applies to every ruby file on the OpenNebula repository # +AllCops: + Include: + - 'src/cli' ######## # LAYOUT diff --git a/src/cli/oneacct b/src/cli/oneacct index b5711587e3..b7cf5dcec2 100755 --- a/src/cli/oneacct +++ b/src/cli/oneacct @@ -77,10 +77,10 @@ CommandParser::CmdParser.new(ARGV) do common_opts = { :start_time => start_time, - :end_time => end_time, - :host => options[:host], - :group => options[:group], - :xpath => options[:xpath] + :end_time => end_time, + :host => options[:host], + :group => options[:group], + :xpath => options[:xpath] } pool = OpenNebula::VirtualMachinePool.new(helper.client) diff --git a/src/cli/oneflow b/src/cli/oneflow index f6a7083f6e..5ceea86c50 100755 --- a/src/cli/oneflow +++ b/src/cli/oneflow @@ -433,9 +433,9 @@ CommandParser::CmdParser.new(ARGV) do command :list, list_desc, :options => Service::JSON_FORMAT do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -452,9 +452,9 @@ CommandParser::CmdParser.new(ARGV) do command :show, show_desc, :service_id, :options => Service::JSON_FORMAT do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -475,9 +475,9 @@ CommandParser::CmdParser.new(ARGV) do Service::TOP, CLIHelper::DELAY] do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -514,9 +514,9 @@ CommandParser::CmdParser.new(ARGV) do command :delete, delete_desc, [:range, :service_id_list] do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -536,9 +536,9 @@ CommandParser::CmdParser.new(ARGV) do command :shutdown, shutdown_desc, [:range, :service_id_list] do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -564,9 +564,9 @@ CommandParser::CmdParser.new(ARGV) do command :recover, recover_desc, [:range, :service_id_list] do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -588,9 +588,9 @@ CommandParser::CmdParser.new(ARGV) do command :scale, scale_desc, :service_id, :role_name, :cardinality, :options => [Service::FORCE] do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -621,9 +621,9 @@ CommandParser::CmdParser.new(ARGV) do command :chgrp, chgrp_desc, [:range, :service_id_list], :groupid do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -644,9 +644,9 @@ CommandParser::CmdParser.new(ARGV) do command :chown, chown_desc, [:range, :service_id_list], :userid, [:groupid, nil] do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -667,9 +667,9 @@ CommandParser::CmdParser.new(ARGV) do command :chmod, chmod_desc, [:range, :service_id_list], :octet do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -689,9 +689,9 @@ CommandParser::CmdParser.new(ARGV) do command :rename, rename_desc, :service_id, :name do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -719,9 +719,9 @@ CommandParser::CmdParser.new(ARGV) do :options => [Service::PERIOD, Service::NUMBER] do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) diff --git a/src/cli/oneflow-template b/src/cli/oneflow-template index 3b037be73a..d3f87fc816 100755 --- a/src/cli/oneflow-template +++ b/src/cli/oneflow-template @@ -185,9 +185,9 @@ CommandParser::CmdParser.new(ARGV) do command :list, list_desc, :options => Service::JSON_FORMAT do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -207,9 +207,9 @@ CommandParser::CmdParser.new(ARGV) do Service::TOP, CLIHelper::DELAY] do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -244,9 +244,9 @@ CommandParser::CmdParser.new(ARGV) do command :create, create_desc, :file, :options => Service::JSON_FORMAT do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -275,9 +275,9 @@ CommandParser::CmdParser.new(ARGV) do command :show, show_desc, :templateid, :options => Service::JSON_FORMAT do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -294,9 +294,9 @@ CommandParser::CmdParser.new(ARGV) do command :delete, delete_desc, [:range, :templateid_list] do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -316,9 +316,9 @@ CommandParser::CmdParser.new(ARGV) do command :instantiate, instantiate_desc, :templateid, [:file, nil], :options => [Service::JSON_FORMAT, Service::TOP] do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -351,9 +351,9 @@ CommandParser::CmdParser.new(ARGV) do command :chgrp, chgrp_desc, [:range, :templateid_list], :groupid do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -374,9 +374,9 @@ CommandParser::CmdParser.new(ARGV) do command :chown, chown_desc, [:range, :templateid_list], :userid, [:groupid, nil] do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -397,9 +397,9 @@ CommandParser::CmdParser.new(ARGV) do command :chmod, chmod_desc, [:range, :templateid_list], :octet do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -419,9 +419,9 @@ CommandParser::CmdParser.new(ARGV) do command :clone, clone_desc, :templateid, :name do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -452,9 +452,9 @@ CommandParser::CmdParser.new(ARGV) do command :rename, rename_desc, :templateid, :name do client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) @@ -481,9 +481,9 @@ CommandParser::CmdParser.new(ARGV) do command :update, update_desc, :templateid, [:file, nil] do template_id = args[0] client = Service::Client.new( - :username => options[:username], - :password => options[:password], - :url => options[:server], + :username => options[:username], + :password => options[:password], + :url => options[:server], :user_agent => USER_AGENT ) diff --git a/src/cli/onehost b/src/cli/onehost index 0a0ba68c9b..1b1a916aa6 100755 --- a/src/cli/onehost +++ b/src/cli/onehost @@ -50,30 +50,30 @@ CommandParser::CmdParser.new(ARGV) do set :option, cmd_options + OpenNebulaHelper::CLIENT_OPTIONS IM = { - :name => 'im', - :short => '-i im_mad', - :large => '--im im_mad', + :name => 'im', + :short => '-i im_mad', + :large => '--im im_mad', :description => 'Set the information driver for the host', :format => String } VMM = { - :name => 'vm', - :short => '-v vmm_mad', - :large => '--vm vmm_mad', + :name => 'vm', + :short => '-v vmm_mad', + :large => '--vm vmm_mad', :description => 'Set the virtualization driver for the host', :format => String } FORCE = { - :name => 'force', - :large => '--force', + :name => 'force', + :large => '--force', :description => 'Force probe upgrade in onehost sync' } RSYNC = { - :name => 'rsync', - :large => '--rsync', + :name => 'rsync', + :large => '--rsync', :description => 'Use rsync to synchronize remotes. In case some '\ 'probes are no longer in the fronted ithey will be '\ 'deleted in the hosts. rsync command must be '\ @@ -81,7 +81,7 @@ CommandParser::CmdParser.new(ARGV) do } TYPE = { - :name => 'type', + :name => 'type', :short => '-t remote_provider', :large => '--type remote_provider', :description => 'Use type to create a host using Cloud Bursting', diff --git a/src/cli/oneimage b/src/cli/oneimage index 2493d4809d..0acd57bb6e 100755 --- a/src/cli/oneimage +++ b/src/cli/oneimage @@ -42,25 +42,25 @@ CommandParser::CmdParser.new(ARGV) do end USE = { - :name => 'use', + :name => 'use', :large => '--use', :description => 'lock use actions' } MANAGE = { - :name => 'manage', + :name => 'manage', :large => '--manage', :description => 'lock manage actions' } ADMIN = { - :name => 'admin', + :name => 'admin', :large => '--admin', :description => 'lock admin actions' } ALL = { - :name => 'all', + :name => 'all', :large => '--all', :description => 'lock all actions' } diff --git a/src/cli/onemarketapp b/src/cli/onemarketapp index d8233e0ad8..64ebb9840b 100755 --- a/src/cli/onemarketapp +++ b/src/cli/onemarketapp @@ -45,25 +45,25 @@ CommandParser::CmdParser.new(ARGV) do end USE = { - :name => 'use', + :name => 'use', :large => '--use', :description => 'lock use actions' } MANAGE = { - :name => 'manage', + :name => 'manage', :large => '--manage', :description => 'lock manage actions' } ADMIN = { - :name => 'admin', + :name => 'admin', :large => '--admin', :description => 'lock admin actions' } ALL = { - :name => 'all', + :name => 'all', :large => '--all', :description => 'lock all actions' } diff --git a/src/cli/oneshowback b/src/cli/oneshowback index 627a183ba3..d8a7b5ca5a 100755 --- a/src/cli/oneshowback +++ b/src/cli/oneshowback @@ -76,11 +76,11 @@ CommandParser::CmdParser.new(ARGV) do common_opts = { :start_month => start_month, - :start_year => start_year, - :end_month => end_month, - :end_year => end_year, - :group => options[:group], - :xpath => options[:xpath] + :start_year => start_year, + :end_month => end_month, + :end_year => end_year, + :group => options[:group], + :xpath => options[:xpath] } pool = OpenNebula::VirtualMachinePool.new(helper.client) diff --git a/src/cli/onetemplate b/src/cli/onetemplate index 64c0696397..bbb254a427 100755 --- a/src/cli/onetemplate +++ b/src/cli/onetemplate @@ -42,25 +42,25 @@ CommandParser::CmdParser.new(ARGV) do end USE = { - :name => 'use', + :name => 'use', :large => '--use', :description => 'lock use actions' } MANAGE = { - :name => 'manage', + :name => 'manage', :large => '--manage', :description => 'lock manage actions' } ADMIN = { - :name => 'admin', + :name => 'admin', :large => '--admin', :description => 'lock admin actions' } ALL = { - :name => 'all', + :name => 'all', :large => '--all', :description => 'lock all actions' } diff --git a/src/cli/oneuser b/src/cli/oneuser index a03fec895c..a6d1066369 100755 --- a/src/cli/oneuser +++ b/src/cli/oneuser @@ -130,7 +130,7 @@ CommandParser::CmdParser.new(ARGV) do } TIME = { - :name => 'time', + :name => 'time', :large => '--time x', :format => Integer, :description => 'Token duration in seconds, defaults to 36000 (10 h). '\ @@ -147,8 +147,8 @@ CommandParser::CmdParser.new(ARGV) do } FORCE = { - :name => 'force', - :large => '--force', + :name => 'force', + :large => '--force', :description => 'Force one_auth file rewrite' } @@ -160,22 +160,22 @@ CommandParser::CmdParser.new(ARGV) do } GROUP = { - :name => 'group', - :large => '--group id|name', + :name => 'group', + :large => '--group id|name', :description => 'Effective GID to use with this token.', :format => String, - :proc => lambda {|o, _| + :proc => lambda {|o, _| OpenNebulaHelper.rname_to_id(o, 'GROUP') } } GROUP_CREATE = { - :name => 'group', - :large => '--group id|name', + :name => 'group', + :large => '--group id|name', :description => 'Comma-separated list of Groups for the new User. '\ 'The first Group will be the main one.', :format => String, - :proc => lambda {|o, _| + :proc => lambda {|o, _| gids = o.split(',').map do |g| id = OpenNebulaHelper.rname_to_id(g, 'GROUP') @@ -192,8 +192,8 @@ CommandParser::CmdParser.new(ARGV) do } GLOBAL = { - :name => 'global', - :large => '--global', + :name => 'global', + :large => '--global', :description => 'Find a global Token.' } diff --git a/src/cli/onevcenter b/src/cli/onevcenter index 03560cf0e2..26ef0e6bc8 100755 --- a/src/cli/onevcenter +++ b/src/cli/onevcenter @@ -77,36 +77,36 @@ CommandParser::CmdParser.new(ARGV) do } VCENTER = { - :name => 'vcenter', - :large => '--vcenter vCenter', + :name => 'vcenter', + :large => '--vcenter vCenter', :description => 'The vCenter hostname', :format => String } USER = { - :name => 'vuser', - :large => '--vuser username', + :name => 'vuser', + :large => '--vuser username', :description => 'The username to interact with vCenter', :format => String } PASS = { - :name => 'vpass', - :large => '--vpass password', + :name => 'vpass', + :large => '--vpass password', :description => 'The password for the user', :format => String } USE_DEFAULTS = { - :name => 'defaults', - :large => '--use-defaults', + :name => 'defaults', + :large => '--use-defaults', :description => 'Use defaults for answers to questions', :format => String } ALL = { - :name => 'all', - :large => '--all', + :name => 'all', + :large => '--all', :description => 'Import all list', :format => String } diff --git a/src/cli/onevm b/src/cli/onevm index 4372cc8b21..c4466fa248 100755 --- a/src/cli/onevm +++ b/src/cli/onevm @@ -80,58 +80,58 @@ CommandParser::CmdParser.new(ARGV) do } ENFORCE = { - :name => 'enforce', + :name => 'enforce', :short => '-e', :large => '--enforce', :description => 'Enforce that the host capacity is not exceeded' } SUCCESS = { - :name => 'success', + :name => 'success', :large => '--success', :description => 'Recover a VM by succeeding the pending action' } FAILURE = { - :name => 'failure', + :name => 'failure', :large => '--failure', :description => 'Recover a VM by failing the pending action' } RETRY = { - :name => 'retry', + :name => 'retry', :large => '--retry', :description => 'Recover a VM by retrying the last failed action' } DELETE = { - :name => 'delete', + :name => 'delete', :large => '--delete', :description => 'No recover action possible, delete the VM' } RECREATE = { - :name => 'recreate', + :name => 'recreate', :large => '--recreate', :description => 'No recover action possible, delete and recreate the VM' } DELETE_DB = { - :name => 'deletedb', + :name => 'deletedb', :large => '--delete-db', :description => 'No recover action possible, delete the VM from the '\ 'DB. It does not trigger any action on the hypervisor' } INTERACTIVE = { - :name => 'interactive', + :name => 'interactive', :large => '--interactive', :description => 'Enables interactive recovery. Only works alongside '\ ' the --retry option.' } SNAP = { - :name => 'snapshot', + :name => 'snapshot', :short => '-s snapshot', :large => '--snapshot snapshot', :format => String, @@ -139,31 +139,31 @@ CommandParser::CmdParser.new(ARGV) do } PERSISTENT = { - :name => 'persistent', + :name => 'persistent', :large => '--persistent', :description => 'Make the new images persistent' } USE = { - :name => 'use', + :name => 'use', :large => '--use', :description => 'lock use actions' } MANAGE = { - :name => 'manage', + :name => 'manage', :large => '--manage', :description => 'lock manage actions' } ADMIN = { - :name => 'admin', + :name => 'admin', :large => '--admin', :description => 'lock admin actions' } ALL = { - :name => 'all', + :name => 'all', :large => '--all', :description => 'lock all actions' } diff --git a/src/cli/onevmgroup b/src/cli/onevmgroup index 9353c3d720..9aa5ab207d 100755 --- a/src/cli/onevmgroup +++ b/src/cli/onevmgroup @@ -41,25 +41,25 @@ CommandParser::CmdParser.new(ARGV) do end USE = { - :name => 'use', + :name => 'use', :large => '--use', :description => 'lock use actions' } MANAGE = { - :name => 'manage', + :name => 'manage', :large => '--manage', :description => 'lock manage actions' } ADMIN = { - :name => 'admin', + :name => 'admin', :large => '--admin', :description => 'lock admin actions' } ALL = { - :name => 'all', + :name => 'all', :large => '--all', :description => 'lock all actions' } diff --git a/src/cli/onevnet b/src/cli/onevnet index b5692c51ae..a52ac9f7c7 100755 --- a/src/cli/onevnet +++ b/src/cli/onevnet @@ -42,25 +42,25 @@ CommandParser::CmdParser.new(ARGV) do end USE = { - :name => 'use', + :name => 'use', :large => '--use', :description => 'lock use actions' } MANAGE = { - :name => 'manage', + :name => 'manage', :large => '--manage', :description => 'lock manage actions' } ADMIN = { - :name => 'admin', + :name => 'admin', :large => '--admin', :description => 'lock admin actions' } ALL = { - :name => 'all', + :name => 'all', :large => '--all', :description => 'lock all actions' } diff --git a/src/cli/onevrouter b/src/cli/onevrouter index 8755315800..9e1ab23af3 100755 --- a/src/cli/onevrouter +++ b/src/cli/onevrouter @@ -43,25 +43,25 @@ CommandParser::CmdParser.new(ARGV) do end USE = { - :name => 'use', + :name => 'use', :large => '--use', :description => 'lock use actions' } MANAGE = { - :name => 'manage', + :name => 'manage', :large => '--manage', :description => 'lock manage actions' } ADMIN = { - :name => 'admin', + :name => 'admin', :large => '--admin', :description => 'lock admin actions' } ALL = { - :name => 'all', + :name => 'all', :large => '--all', :description => 'lock all actions' }