morpheus-cli 5.4.4 → 5.4.4.1

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: e88f25d69ce8a6c1038899e3671c69a31266607d3370b2c4a20d3fa74d76dc42
4
- data.tar.gz: '08ccc023d2cc5908a7a8f9a8a3cde3ec9cd11e08b85e53b1732aecc0e38ab166'
3
+ metadata.gz: e7982ab3b4bcc7849f28a571df308c6bc8d588fbb5748b29f1b2589cb92fbf64
4
+ data.tar.gz: 49d643efdf4b181a7a4ba35325159fd33edb4c5330c4de6a0e136184a5f4a0fa
5
5
  SHA512:
6
- metadata.gz: 1a21ebb4f7b58cbd5aede974f4bb298a19a02c4aad9f92fbe0c149d5cde3a80dfdf141fbf7aca66ce9cf1c2fc9a4495f51e3c6fcea9ee7458a4153ed3c6bb1d9
7
- data.tar.gz: f9412dd77a1c90346133832363ac8d756b0f4576b4a3102024552dba4c63d566430b57a3b53395080f928b88b5354f446bdc3bb9df6d1351b5994419ca884623
6
+ metadata.gz: a4f3f440b1b50e57d8de2a6f85f33f626be9c055da36df2574b1cc951cbab7a8ba632ff83da1c618a322c06ece0002f4c889ee5c4157cee8d3aea1c876de213c
7
+ data.tar.gz: 3a3ce759067f652d0e3552e92d53c92e931dfa3122fc857cc7a889212fb197e5417bfd275e4853b83fc08404ed950bff0fcf73cc28cdc55667d32ea7404ca467
data/Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
1
  FROM ruby:2.5.1
2
2
 
3
- RUN gem install morpheus-cli -v 5.4.4
3
+ RUN gem install morpheus-cli -v 5.4.4.1
4
4
 
5
5
  ENTRYPOINT ["morpheus"]
@@ -4403,9 +4403,20 @@ EOT
4403
4403
  #if instance['layout']['provisionTypeCode'] == 'vmware'
4404
4404
  if provision_type && provision_type["hasFolders"]
4405
4405
  if payload['zoneFolder'].nil?
4406
- v_prompt = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'zoneFolder', 'type' => 'select', 'optionSource' => 'vmwareFolders', 'fieldLabel' => 'Folder', 'description' => "Folder externalId or '/' to use the root folder", 'required' => true}], options[:options], @api_client, {siteId: instance['group']['id'], zoneId: instance['cloud']['id']})
4407
- if v_prompt['zoneFolder'].to_s != ''
4408
- payload['zoneFolder'] = v_prompt['zoneFolder']
4406
+ # vmwareFolders moved from /api/options/vmwareFolders to /api/options/vmware/vmwareFolders
4407
+ folder_prompt = nil
4408
+ begin
4409
+ folder_prompt = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'zoneFolder', 'type' => 'select', 'optionSource' => 'vmwareFolders', 'optionSourceType' => 'vmware', 'fieldLabel' => 'Folder', 'description' => "Folder externalId or '/' to use the root folder", 'required' => true}], options[:options], @api_client, {siteId: instance['group']['id'], zoneId: instance['cloud']['id']})
4410
+ rescue RestClient::Exception => e
4411
+ Morpheus::Logging::DarkPrinter.puts "Failed to load folder options" if Morpheus::Logging.debug?
4412
+ begin
4413
+ folder_prompt = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'zoneFolder', 'type' => 'select', 'optionSource' => 'vmwareFolders', 'fieldLabel' => 'Folder', 'description' => "Folder externalId or '/' to use the root folder", 'required' => true}], options[:options], @api_client, {siteId: instance['group']['id'], zoneId: instance['cloud']['id']})
4414
+ rescue RestClient::Exception => e2
4415
+ Morpheus::Logging::DarkPrinter.puts "Failed to load folder options from alternative endpoint too" if Morpheus::Logging.debug?
4416
+ end
4417
+ end
4418
+ if folder_prompt && folder_prompt['zoneFolder'].to_s != ''
4419
+ payload['zoneFolder'] = folder_prompt['zoneFolder']
4409
4420
  end
4410
4421
  end
4411
4422
  end
@@ -495,10 +495,16 @@ EOT
495
495
  return
496
496
  end
497
497
  json_response = rest_interface.create(parent_id, payload)
498
- render_response(json_response, options, rest_object_key) do
499
- record = json_response[rest_object_key]
500
- print_green_success "Added #{rest_label.downcase} #{record['name'] || record['id']}"
501
- return _get(parent_id, record["id"], {}, options)
498
+ if json_response['success']
499
+ render_response(json_response, options, rest_object_key) do
500
+ record = json_response[rest_object_key]
501
+ print_green_success "Added #{rest_label.downcase} #{record['name'] || record['id']}"
502
+ return _get(parent_id, record["id"], {}, options)
503
+ end
504
+ else
505
+ print red
506
+ print json_response['msg']
507
+ print "\n"
502
508
  end
503
509
  return 0, nil
504
510
  end
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Morpheus
3
3
  module Cli
4
- VERSION = "5.4.4"
4
+ VERSION = "5.4.4.1"
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: 5.4.4
4
+ version: 5.4.4.1
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: 2022-03-10 00:00:00.000000000 Z
14
+ date: 2022-03-11 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler