1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

L #-: Fix extra space after initial block def

In accordance to new default rules in rubocop 0.71.0
This commit is contained in:
Tino Vazquez 2019-06-03 13:36:24 +02:00
parent 237f32a642
commit 26ed3d5570
No known key found for this signature in database
GPG Key ID: 2FE9C32E94AEABBE
13 changed files with 0 additions and 38 deletions

View File

@ -85,7 +85,6 @@ CommandParser::CmdParser.new(ARGV) do
command :create, create_desc, :file,
:options => [OneClusterHelper::CLUSTER] do
cid = options[:cluster] || ClusterPool::NONE_CLUSTER_ID
helper.create_resource(options) do |datastore|

View File

@ -717,7 +717,6 @@ CommandParser::CmdParser.new(ARGV) do
command :action, action_desc, :service_id, :role_name, :vm_action,
:options => [Service::PERIOD, Service::NUMBER] do
client = Service::Client.new(
:username => options[:username],
:password => options[:password],

View File

@ -86,7 +86,6 @@ CommandParser::CmdParser.new(ARGV) do
command :create, create_desc, [:group_name, nil], :options =>
OpenNebulaHelper::GROUP_OPTIONS do
if options && options[:admin_user]
if !options[:admin_password]
STDERR.puts 'Admin user needs password'

View File

@ -142,7 +142,6 @@ CommandParser::CmdParser.new(ARGV) do
create_desc,
[:file, nil],
:options => CREATE_OPTIONS + OneImageHelper::TEMPLATE_OPTIONS do
if options[:datastore].nil? && !options[:dry]
STDERR.puts 'Datastore to save the image is mandatory: '
STDERR.puts '\t -d datastore_id'

View File

@ -117,7 +117,6 @@ CommandParser::CmdParser.new(ARGV) do
command :create, create_desc, [:file, nil],
:options => CREATE_OPTIONS +
OneMarketPlaceAppHelper::TEMPLATE_OPTIONS do
if options[:marketplace].nil?
STDERR.puts 'Marketplace to save the app is mandatory: '
STDERR.puts '\t -m marketplace_id'
@ -216,7 +215,6 @@ CommandParser::CmdParser.new(ARGV) do
command :update, update_desc, :appid, [:file, nil],
:options => OpenNebulaHelper::APPEND do
helper.perform_action(args[0], options, 'modified') do |obj|
if options[:append]
str = OpenNebulaHelper.append_template(args[0], obj, args[1])

View File

@ -50,7 +50,6 @@ CommandParser::CmdParser.new(ARGV) do
AcctHelper::SHOWBACK_OPTIONS + CommandParser::OPTIONS +
[OpenNebulaHelper::DESCRIBE, CLIHelper::LIST, CLIHelper::CSV_OPT] +
OpenNebulaHelper::CLIENT_OPTIONS do
if options[:describe]
AcctHelper::SHOWBACK_TABLE.describe_columns
exit(0)
@ -142,7 +141,6 @@ CommandParser::CmdParser.new(ARGV) do
command :calculate, 'Calculates the showback records', :options =>
[AcctHelper::START_TIME_SHOWBACK, AcctHelper::END_TIME_SHOWBACK] do
start_month = -1
start_year = -1

View File

@ -133,7 +133,6 @@ CommandParser::CmdParser.new(ARGV) do
command :create, create_desc, [:file, nil], :options =>
[OneTemplateHelper::VM_NAME] + OpenNebulaHelper::TEMPLATE_OPTIONS +
[OpenNebulaHelper::DRY] do
if args[0] && OpenNebulaHelper.create_template_options_used?(options)
STDERR.puts 'You can not use both template file and template' \
' creation options.'
@ -174,7 +173,6 @@ CommandParser::CmdParser.new(ARGV) do
command :clone, clone_desc, :templateid, :name,
:options => OneTemplateHelper::RECURSIVE do
recursive = (options[:recursive] == true)
helper.perform_action(args[0], options, 'cloned') do |t|
@ -194,7 +192,6 @@ CommandParser::CmdParser.new(ARGV) do
command :delete, delete_desc, [:range, :templateid_list],
:options => OneTemplateHelper::RECURSIVE do
recursive = (options[:recursive] == true)
helper.perform_actions(args[0], options, 'deleted') do |t|
@ -306,7 +303,6 @@ CommandParser::CmdParser.new(ARGV) do
command :chmod, chmod_desc, [:range, :templateid_list], :octet,
:options => OneTemplateHelper::RECURSIVE do
recursive = (options[:recursive] == true)
helper.perform_actions(args[0], options, 'Permissions changed') do |t|
@ -359,7 +355,6 @@ CommandParser::CmdParser.new(ARGV) do
command :show, show_desc, :templateid,
:options => [OpenNebulaHelper::XML, OneTemplateHelper::EXTENDED] do
helper.show_resource(args[0], options)
end

View File

@ -386,7 +386,6 @@ CommandParser::CmdParser.new(ARGV) do
command :umask, umask_desc, [:range, :userid_list], [:mask, nil] do
helper.perform_actions(args[0], options,
'umask changed') do |user|
rc = user.info
if OpenNebula.is_error?(rc)
@ -582,7 +581,6 @@ CommandParser::CmdParser.new(ARGV) do
command :passwdsearch, passwdsearch_desc, :driver, :password,
:options => [CLIHelper::CSV_OPT, OpenNebulaHelper::XML] do
options[:list] = %w[ID NAME AUTH PASSWORD]
options[:filter] = ["AUTH=#{args[0]}", "PASSWORD=#{args[1]}"]
@ -618,7 +616,6 @@ CommandParser::CmdParser.new(ARGV) do
command :"token-create", token_add_desc, [:username, nil],
:options => login_options do
helper.token_create(args, options)
end
@ -648,7 +645,6 @@ CommandParser::CmdParser.new(ARGV) do
command :"token-set", token_set_desc, [:username, nil],
:options => login_options + set_options do
username = args[0]
if username
@ -731,7 +727,6 @@ CommandParser::CmdParser.new(ARGV) do
command :"token-delete", token_delete_desc, [:username, nil], :token,
:options => login_options do
if args.length == 1
token_hint = args[0]
else
@ -793,7 +788,6 @@ CommandParser::CmdParser.new(ARGV) do
command :"token-delete-all", token_delete_all, :username,
:options => login_options do
username = args[0]
if username =~ /^\d+$/

View File

@ -72,7 +72,6 @@ CommandParser::CmdParser.new(ARGV) do
set :format, :clusterid,
"#{OpenNebulaHelper.rname_to_id_desc('CLUSTER')}. "\
'Can be set to ALL' do |arg|
if !arg.nil? &&
arg.class != Integer &&
arg.casecmp('ALL').zero?
@ -85,7 +84,6 @@ CommandParser::CmdParser.new(ARGV) do
set :format, :hostid,
"#{OpenNebulaHelper.rname_to_id_desc('HOST')}. "\
'Can be set to ALL' do |arg|
if !arg.nil? &&
arg.class != Integer &&
arg.casecmp('ALL').zero?
@ -98,7 +96,6 @@ CommandParser::CmdParser.new(ARGV) do
set :format, :datastoreid,
"#{OpenNebulaHelper.rname_to_id_desc('DATASTORE')}. "\
'Can be set to ALL' do |arg|
if !arg.nil? &&
arg.class != Integer &&
arg.casecmp('ALL').zero?
@ -111,7 +108,6 @@ CommandParser::CmdParser.new(ARGV) do
set :format, :vnetid,
"#{OpenNebulaHelper.rname_to_id_desc('VNET')}. "\
'Can be set to ALL' do |arg|
if !arg.nil? &&
arg.class != Integer &&
arg.casecmp('ALL').zero?

View File

@ -249,7 +249,6 @@ CommandParser::CmdParser.new(ARGV) do
command :create, create_desc, [:file, nil], :options =>
[OneVMHelper::MULTIPLE, OneVMHelper::HOLD] +
OpenNebulaHelper::TEMPLATE_OPTIONS_VM do
number = options[:multiple] || 1
exit_code = nil
@ -373,7 +372,6 @@ CommandParser::CmdParser.new(ARGV) do
command :"disk-saveas", disk_saveas_desc, :vmid, :diskid, :img_name,
:options => [TYPE, SNAP] do
disk_id = args[1].to_i
image_name = args[2]
image_type = options[:type] || ''
@ -418,7 +416,6 @@ CommandParser::CmdParser.new(ARGV) do
OneVMHelper::HOURLY,
OneVMHelper::END_TIME,
OneVMHelper::HARD] do
command_name = 'terminate'
command_name << '-hard' if options[:hard]
@ -447,7 +444,6 @@ CommandParser::CmdParser.new(ARGV) do
OneVMHelper::HOURLY,
OneVMHelper::END_TIME,
OneVMHelper::HARD] do
command_name = 'undeploy'
command_name << '-hard' if options[:hard]
@ -475,7 +471,6 @@ CommandParser::CmdParser.new(ARGV) do
OneVMHelper::HOURLY,
OneVMHelper::END_TIME,
OneVMHelper::HARD] do
command_name = 'poweroff'
command_name << '-hard' if options[:hard]
@ -505,7 +500,6 @@ CommandParser::CmdParser.new(ARGV) do
OneVMHelper::HOURLY,
OneVMHelper::END_TIME,
OneVMHelper::HARD] do
command_name = 'reboot'
command_name << '-hard' if options[:hard]
@ -711,7 +705,6 @@ CommandParser::CmdParser.new(ARGV) do
command :"disk-attach", disk_attach_desc, :vmid,
:options => [OneVMHelper::FILE, OneVMHelper::IMAGE,
TARGET, CACHE, DISCARD, PREFIX] do
if options[:file].nil? && options[:image].nil?
STDERR.puts 'Provide a template file or an image:'
STDERR.puts '\t--file <file>'
@ -779,7 +772,6 @@ CommandParser::CmdParser.new(ARGV) do
OneVMHelper::IP,
OneVMHelper::ALIAS,
OneVMHelper::NIC_NAME] do
if options[:file].nil? && options[:network].nil?
STDERR.puts 'Provide a template file or a network:'
STDERR.puts "\t--file <file>"
@ -924,7 +916,6 @@ CommandParser::CmdParser.new(ARGV) do
OneVMHelper::YEARLY,
OneVMHelper::HOURLY,
OneVMHelper::END_TIME] do
if !options[:schedule].nil?
helper.schedule_actions(args[0], options, @comm_name)
else
@ -1099,7 +1090,6 @@ CommandParser::CmdParser.new(ARGV) do
command :resize, resize_desc, :vmid,
:options => OpenNebulaHelper::CAPACITY_OPTIONS_VM +
[ENFORCE, OneVMHelper::FILE] do
if options[:file]
template = File.read(options[:file])
else

View File

@ -122,7 +122,6 @@ CommandParser::CmdParser.new(ARGV) do
command :create, create_desc, [:file, nil], :options =>
[OpenNebulaHelper::DRY] do
helper.create_resource(options) do |tmpl|
begin
if args[0]
@ -307,7 +306,6 @@ CommandParser::CmdParser.new(ARGV) do
command :show, show_desc, :templateid,
:options => [OpenNebulaHelper::XML, OneTemplateHelper::EXTENDED] do
helper.show_resource(args[0], options)
end

View File

@ -146,7 +146,6 @@ CommandParser::CmdParser.new(ARGV) do
:vrouterid, :templateid, [:file, nil],
:options => instantiate_options +
OpenNebulaHelper::TEMPLATE_OPTIONS do
if args[2] && OpenNebulaHelper.create_template_options_used?(options)
STDERR.puts 'You cannot use both template file and template' \
' creation options.'
@ -275,7 +274,6 @@ CommandParser::CmdParser.new(ARGV) do
OneVMHelper::NETWORK,
OneVMHelper::IP,
OneVirtualRouterHelper::FLOAT] do
if options[:file].nil? && options[:network].nil?
STDERR.puts 'Provide a template file or a network:'
STDERR.puts "\t--file <file>"

View File

@ -106,7 +106,6 @@ CommandParser::CmdParser.new(ARGV) do
command :"server-add", addserver_desc, :zoneid, :options =>
[OneZoneHelper::SERVER_NAME, OneZoneHelper::SERVER_ENDPOINT] do
if options[:server_name].nil? || options[:server_rpc].nil?
STDERR.puts 'To add a server set:'
STDERR.puts "\t-n <server name>"