morpheus-cli 4.1.2 → 4.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7753eaeda16637f0e5dc4789805e09872fa92cc7bd487f6abebdbc30f021211c
4
- data.tar.gz: 44b028c23aa86ca2bf4a4d648930985fd55c7050713ad483ea0ae9f1419b4283
3
+ metadata.gz: b5b4dd8489e5b1b5ba7161972495bafb0267a735718da283fbfd9cb4c1013955
4
+ data.tar.gz: 9206c9bd953acc94ef919078f52136068e58716ccbf083abe4afa903ce0fd08c
5
5
  SHA512:
6
- metadata.gz: 577cd169ab4f3235e536d46603f744b39c233a09664fbe4b81294c662ffbeceb5f4402c763b3653446e17ad021b31ac0bc58c96232fe2b27ce17c6d0dd5f03f4
7
- data.tar.gz: 0e185c2007c4f5c7ca8c7158f0ecc872faeecdc34773e19bb61983c45238a798038652df07a0ea3dfde0c75bf5dfae4c2c04347841b1d730f70524aa664373e5
6
+ metadata.gz: 413a0d0b72fedc846244a85d06ba92792e6bbde16c27c8f8ce8aaaae7d5dab461640898c121d6bdeaf020640fa833306032a58e4ad3858726c8ee2e47d8244ac
7
+ data.tar.gz: aa77f2f657cb7a3842c696df46668b5416d29f703976ace1018dc8f726e9c79be2df9283f92c4099c86b3e4d27b9032e1a1a63a6b981bbeaf95b3a79ecc5adc7
@@ -3553,15 +3553,15 @@ private
3553
3553
  def find_zone_by_name_or_id(group_id, val)
3554
3554
  zone = nil
3555
3555
  if val.to_s =~ /\A\d{1,}\Z/
3556
- json_results = @clouds_interface.get(val.to_i)
3557
- zone = json_results['zone']
3556
+ clouds = get_available_clouds(group_id)
3557
+ zone = clouds.find {|it| it['id'] == val.to_i }
3558
3558
  if zone.nil?
3559
3559
  print_red_alert "Cloud not found by id #{val}"
3560
3560
  exit 1
3561
3561
  end
3562
3562
  else
3563
- json_results = @clouds_interface.get({groupId: group_id, name: val})
3564
- zone = json_results['zones'] ? json_results['zones'][0] : nil
3563
+ clouds = get_available_clouds(group_id)
3564
+ zone = clouds.find {|it| it['name'] == val.to_s }
3565
3565
  if zone.nil?
3566
3566
  print_red_alert "Cloud not found by name #{val}"
3567
3567
  exit 1
@@ -3569,6 +3569,7 @@ private
3569
3569
  end
3570
3570
  return zone
3571
3571
  end
3572
+
3572
3573
  def find_host_by_id(id)
3573
3574
  begin
3574
3575
  json_response = @servers_interface.get(id.to_i)
@@ -339,13 +339,13 @@ module Morpheus
339
339
  input = Readline.readline("#{option_type['fieldLabel']}#{option_type['fieldAddOn'] ? ('(' + option_type['fieldAddOn'] + ') ') : '' }#{!option_type['required'] ? ' (optional)' : ''}#{!default_value.to_s.empty? ? ' ['+default_value.to_s+']' : ''} ['?' for options]: ", false).to_s
340
340
  input = input.chomp.strip
341
341
  if input.empty? && default_value
342
- input = default_value
342
+ input = default_value.to_s
343
343
  end
344
344
  select_option = select_options.find{|b| b['name'] == input || (!b['value'].nil? && b['value'].to_s == input) || (b['value'].nil? && input.empty?)}
345
345
  if select_option
346
346
  value = select_option['value']
347
347
  set_last_select(select_option)
348
- elsif !input.nil? && !input.empty?
348
+ elsif !input.nil? && !input.to_s.empty?
349
349
  input = '?'
350
350
  end
351
351
 
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Morpheus
3
3
  module Cli
4
- VERSION = "4.1.2"
4
+ VERSION = "4.1.3"
5
5
  end
6
6
  end
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.1.2
4
+ version: 4.1.3
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: 2019-10-11 00:00:00.000000000 Z
14
+ date: 2019-10-14 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler