morpheus-cli 4.2.11 → 4.2.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dockerfile +1 -1
- data/lib/morpheus/cli/apps.rb +2 -1
- data/lib/morpheus/cli/cli_command.rb +84 -4
- data/lib/morpheus/cli/cli_registry.rb +10 -1
- data/lib/morpheus/cli/clusters.rb +2 -1
- data/lib/morpheus/cli/commands/standard/benchmark_command.rb +16 -13
- data/lib/morpheus/cli/containers_command.rb +2 -1
- data/lib/morpheus/cli/credentials.rb +1 -1
- data/lib/morpheus/cli/health_command.rb +4 -3
- data/lib/morpheus/cli/hosts.rb +2 -1
- data/lib/morpheus/cli/instances.rb +2 -1
- data/lib/morpheus/cli/invoices_command.rb +412 -227
- data/lib/morpheus/cli/library_option_lists_command.rb +61 -125
- data/lib/morpheus/cli/library_option_types_command.rb +32 -37
- data/lib/morpheus/cli/logs_command.rb +3 -2
- data/lib/morpheus/cli/mixins/library_helper.rb +32 -0
- data/lib/morpheus/cli/mixins/logs_helper.rb +18 -9
- data/lib/morpheus/cli/mixins/print_helper.rb +39 -10
- data/lib/morpheus/cli/mixins/provisioning_helper.rb +12 -1
- data/lib/morpheus/cli/option_types.rb +45 -9
- data/lib/morpheus/cli/price_sets_command.rb +1 -1
- data/lib/morpheus/cli/projects_command.rb +51 -121
- data/lib/morpheus/cli/remote.rb +5 -8
- data/lib/morpheus/cli/users.rb +1 -1
- data/lib/morpheus/cli/version.rb +1 -1
- data/lib/morpheus/formatters.rb +7 -19
- metadata +2 -2
data/lib/morpheus/cli/remote.rb
CHANGED
@@ -302,15 +302,12 @@ EOT
|
|
302
302
|
# secure is the default,
|
303
303
|
# try to only store insecure:false in the appliances config
|
304
304
|
if url.to_s =~ /^https\:/ && secure.nil?
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
#v_prompt = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'secure', 'fieldLabel' => 'Secure', 'type' => 'checkbox', 'required' => false, 'defaultValue' => true, 'description' => 'Prevent insecure HTTPS communication, respect SSL errors.'}], options[:options])
|
309
|
-
v_prompt = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'insecure', 'fieldLabel' => 'Insecure (Ignore SSL Errors)', 'type' => 'checkbox', 'required' => false, 'defaultValue' => false, 'description' => 'Allow insecure HTTPS communication, ignore SSL errors.'}], options[:options])
|
310
|
-
if v_prompt['insecure'].to_s == 'true' || v_prompt['insecure'].to_s == 'on'
|
311
|
-
new_appliance_map[:insecure] = true
|
312
|
-
end
|
305
|
+
v_prompt = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'insecure', 'fieldLabel' => 'Insecure (Ignore SSL Errors)', 'type' => 'checkbox', 'required' => false, 'defaultValue' => false, 'description' => 'Allow insecure HTTPS communication, ignore SSL errors.'}], options[:options])
|
306
|
+
if v_prompt['insecure'].to_s == 'true' || v_prompt['insecure'].to_s == 'on'
|
307
|
+
new_appliance_map[:insecure] = true
|
313
308
|
end
|
309
|
+
elsif secure != nil
|
310
|
+
new_appliance_map[:insecure] = !secure
|
314
311
|
end
|
315
312
|
|
316
313
|
# --use
|
data/lib/morpheus/cli/users.rb
CHANGED
@@ -698,7 +698,7 @@ EOT
|
|
698
698
|
{'fieldName' => 'password', 'fieldLabel' => 'Password', 'type' => 'password', 'required' => true, 'displayOrder' => 5},
|
699
699
|
{'fieldName' => 'passwordConfirmation', 'fieldLabel' => 'Confirm Password', 'type' => 'password', 'required' => true, 'displayOrder' => 6},
|
700
700
|
{'fieldName' => 'role', 'fieldLabel' => 'Role', 'type' => 'text', 'description' => "Role names (comma separated)", 'displayOrder' => 7},
|
701
|
-
{'fieldName' => 'receiveNotifications', 'fieldLabel' => '
|
701
|
+
{'fieldName' => 'receiveNotifications', 'fieldLabel' => 'Receive Notifications?', 'type' => 'checkbox', 'required' => false, 'defaultValue' => true, 'displayOrder' => 58},
|
702
702
|
{'fieldName' => 'linuxUsername', 'fieldLabel' => 'Linux Username', 'type' => 'text', 'required' => false, 'displayOrder' => 9},
|
703
703
|
# {'fieldName' => 'linuxPassword', 'fieldLabel' => 'Linux Password', 'type' => 'password', 'required' => false, 'displayOrder' => 10},
|
704
704
|
{'fieldName' => 'windowsUsername', 'fieldLabel' => 'Windows Username', 'type' => 'text', 'required' => false, 'displayOrder' => 11},
|
data/lib/morpheus/cli/version.rb
CHANGED
data/lib/morpheus/formatters.rb
CHANGED
@@ -365,14 +365,8 @@ def format_number(n, opts={})
|
|
365
365
|
return out
|
366
366
|
end
|
367
367
|
|
368
|
-
def format_sig_dig(n,
|
369
|
-
|
370
|
-
parts = n.to_f.round(sig_dig).to_s.split(".")
|
371
|
-
if parts.size > 1 && sig_dig
|
372
|
-
parts[1] = parts[1].ljust(sig_dig, "0")
|
373
|
-
end
|
374
|
-
out << parts.join(".")
|
375
|
-
return out
|
368
|
+
def format_sig_dig(n, sigdig=3)
|
369
|
+
sprintf("%.#{sigdig}f", n)
|
376
370
|
end
|
377
371
|
|
378
372
|
def currency_sym(currency)
|
@@ -382,22 +376,16 @@ end
|
|
382
376
|
# returns currency amount formatted like "$4,5123.00". 0.00 is formatted as "$0"
|
383
377
|
# this is not ideal
|
384
378
|
def format_money(amount, currency='usd', opts={})
|
385
|
-
|
379
|
+
amount = amount.to_f
|
380
|
+
if amount == 0
|
386
381
|
return currency_sym(currency).to_s + "0"
|
387
382
|
# elsif amount.to_f < 0.01
|
388
383
|
# # return exponent notation like 3.4e-09
|
389
384
|
# return currency_sym(currency).to_s + "#{amount}"
|
390
385
|
else
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
elsif rtn.split('.')[1].length < 2
|
395
|
-
rtn = rtn + (['0'] * (2 - rtn.split('.')[1].length) * '')
|
396
|
-
end
|
397
|
-
dollars,cents = rtn.split(".")
|
398
|
-
rtn = currency_sym(currency).to_s + format_number(dollars.to_i.abs) + "." + cents
|
399
|
-
|
400
|
-
if dollars.to_i < 0
|
386
|
+
sigdig = opts[:sigdig] ? opts[:sigdig].to_i : 2
|
387
|
+
rtn = currency_sym(currency).to_s + format_number(sprintf("%.#{sigdig}f", amount))
|
388
|
+
if amount.to_i < 0
|
401
389
|
rtn = "(#{rtn})"
|
402
390
|
if opts[:minus_color]
|
403
391
|
rtn = "#{opts[:minus_color]}#{rtn}#{opts[:return_color] || cyan}"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: morpheus-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Estes
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2020-
|
14
|
+
date: 2020-06-18 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|