morpheus-cli 3.6.7 → 3.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/morpheus/cli/credentials.rb +8 -0
- data/lib/morpheus/cli/login.rb +1 -5
- data/lib/morpheus/cli/remote.rb +17 -20
- data/lib/morpheus/cli/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f07f82c8c3a9f9040ddd94a5d7537c5bd0f060c2299964f6338876eea0886a84
|
|
4
|
+
data.tar.gz: fc432221b5e84bc65cf18daba858aad0f491700c5b6fcc02a2092ab6e504d4b9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
data/lib/morpheus/cli/login.rb
CHANGED
|
@@ -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::
|
|
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]
|
data/lib/morpheus/cli/remote.rb
CHANGED
|
@@ -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
|
-
#
|
|
613
|
-
Morpheus::Cli::
|
|
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
|
-
#
|
|
643
|
-
Morpheus::Cli::
|
|
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
|
data/lib/morpheus/cli/version.rb
CHANGED