1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

Adjust alignment for new rubocop version

This commit is contained in:
Tino Vazquez 2018-11-23 22:08:54 +01:00
parent 89381e11e4
commit 7bd6a8d2fb
15 changed files with 154 additions and 151 deletions

View File

@ -3,6 +3,9 @@
# Applies to every ruby file on the OpenNebula repository
#
AllCops:
Include:
- 'src/cli'
########
# LAYOUT

View File

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

View File

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

View File

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

View File

@ -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',

View File

@ -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'
}

View File

@ -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'
}

View File

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

View File

@ -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'
}

View File

@ -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.'
}

View File

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

View File

@ -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'
}

View File

@ -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'
}

View File

@ -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'
}

View File

@ -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'
}