morpheus-cli 3.6.7 → 3.6.8

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: 7fb66614a0f521d326378762305f731b8feaba20f65f5b08795a65389edab957
4
- data.tar.gz: 4fca1eda17c8916ec93d937a893d9d7e3793c913a8058db434043b443c0e8773
3
+ metadata.gz: f07f82c8c3a9f9040ddd94a5d7537c5bd0f060c2299964f6338876eea0886a84
4
+ data.tar.gz: fc432221b5e84bc65cf18daba858aad0f491700c5b6fcc02a2092ab6e504d4b9
5
5
  SHA512:
6
- metadata.gz: 6e4e3064928cbdc7679746463fb078e1b74818caeee2f3141b19bcdbb0f357924340883a321e67da830dcca4cc958e78fd5cd4f79c4c5674569ad2bb400bc4bb
7
- data.tar.gz: c2e8593449ecab682f3346dfbacad7d0a6b63aea6ce2a16fcf6e52f07fd982e65d4c7a3fb06cd5332733b51404fa084301c12e5c975a8bcbfa14ed0414059f39
6
+ metadata.gz: dd6fe7211b9b4634daa9a497786cb755b7f8127860810d06903398d4ada337dd02cd1a6cdb68aa244773783277131dc2a08bc2fe2be6b912da01daf5d3983d04
7
+ data.tar.gz: 696525d04100e85028de52f8417bdf3449815236e1da81a57d5d9418d79fbaa82a554a3b774f45d46f7c6d6c7a096c3b3e63d77f61376d43d88218a8bfb42fc8
@@ -214,6 +214,14 @@ module Morpheus
214
214
  @@appliance_credentials_map = credential_map
215
215
  rescue => e
216
216
  puts "failed to save #{fn}. #{e}" if Morpheus::Logging.debug?
217
+ ensure
218
+ # recalcuate echo vars
219
+ #puts "Recalculating variable maps for username change"
220
+ Morpheus::Cli::Echo.recalculate_variable_map()
221
+ # recalculate shell prompt after this change
222
+ if Morpheus::Cli::Shell.has_instance?
223
+ Morpheus::Cli::Shell.instance.reinitialize()
224
+ end
217
225
  end
218
226
  end
219
227
  end
@@ -79,11 +79,7 @@ class Morpheus::Cli::Login
79
79
  creds = Morpheus::Cli::Credentials.new(@appliance_name, @appliance_url).load_saved_credentials() # .load_saved_credentials(true)
80
80
 
81
81
  # recalcuate echo vars
82
- Morpheus::Cli::Echo.recalculate_variable_map()
83
- # recalculate shell prompt after this change
84
- if Morpheus::Cli::Shell.has_instance?
85
- Morpheus::Cli::Shell.instance.reinitialize()
86
- end
82
+ ::Morpheus::Cli::Remote.recalculate_variable_map()
87
83
 
88
84
  if creds
89
85
  if !options[:quiet]
@@ -560,19 +560,13 @@ EOT
560
560
 
561
561
  # ok, delete it
562
562
  ::Morpheus::Cli::Remote.delete_remote(appliance_name)
563
-
563
+
564
564
  # return result
565
565
  if options[:quiet]
566
566
  return 0, nil
567
567
  end
568
568
  print_green_success "Deleted remote #{appliance_name}"
569
569
  list([])
570
- # recalcuate echo vars
571
- Morpheus::Cli::Echo.recalculate_variable_map()
572
- # recalculate shell prompt after this change
573
- if Morpheus::Cli::Shell.has_instance?
574
- Morpheus::Cli::Shell.instance.reinitialize()
575
- end
576
570
  return 0, nil
577
571
  end
578
572
 
@@ -609,12 +603,8 @@ EOT
609
603
  appliance[:active] = true
610
604
  appliance = ::Morpheus::Cli::Remote.save_remote(appliance_name, appliance)
611
605
 
612
- # recalcuate echo vars
613
- Morpheus::Cli::Echo.recalculate_variable_map()
614
- # recalculate shell prompt after this change
615
- if Morpheus::Cli::Shell.has_instance?
616
- Morpheus::Cli::Shell.instance.reinitialize()
617
- end
606
+ # recalculate session variables
607
+ ::Morpheus::Cli::Remote.recalculate_variable_map()
618
608
 
619
609
  if !options[:quiet]
620
610
  puts "#{cyan}Using remote #{appliance_name}#{reset}"
@@ -639,12 +629,8 @@ EOT
639
629
  end
640
630
  Morpheus::Cli::Remote.clear_active_appliance()
641
631
  puts "You are no longer using the appliance #{@appliance_name}"
642
- # recalcuate echo vars
643
- Morpheus::Cli::Echo.recalculate_variable_map()
644
- # recalculate shell prompt after this change
645
- if Morpheus::Cli::Shell.has_instance?
646
- Morpheus::Cli::Shell.instance.reinitialize()
647
- end
632
+ # recalculate session variables
633
+ ::Morpheus::Cli::Remote.recalculate_variable_map()
648
634
  return true
649
635
  end
650
636
 
@@ -1126,7 +1112,8 @@ EOT
1126
1112
 
1127
1113
  # persist all appliances
1128
1114
  save_appliances(cur_appliances)
1129
-
1115
+ # recalculate session variables
1116
+ recalculate_variable_map()
1130
1117
  return app_map
1131
1118
  end
1132
1119
 
@@ -1144,6 +1131,8 @@ EOT
1144
1131
  ::Morpheus::Cli::Credentials.new(app_name, nil).clear_saved_credentials(app_name)
1145
1132
  # delete from groups too..
1146
1133
  ::Morpheus::Cli::Groups.clear_active_group(app_name)
1134
+ # recalculate session variables
1135
+ recalculate_variable_map()
1147
1136
  # return the deleted value
1148
1137
  return app_map
1149
1138
  end
@@ -1250,6 +1239,14 @@ EOT
1250
1239
 
1251
1240
  end
1252
1241
 
1242
+ def recalculate_variable_map()
1243
+ Morpheus::Cli::Echo.recalculate_variable_map()
1244
+ # recalculate shell prompt after this change
1245
+ if Morpheus::Cli::Shell.has_instance?
1246
+ Morpheus::Cli::Shell.instance.reinitialize()
1247
+ end
1248
+ end
1249
+
1253
1250
  end
1254
1251
 
1255
1252
  end
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Morpheus
3
3
  module Cli
4
- VERSION = "3.6.7"
4
+ VERSION = "3.6.8"
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: 3.6.7
4
+ version: 3.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Estes