RaaS 0.0.4 → 0.0.5
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 +8 -8
- data/lib/RaaSmain.rb +29 -27
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OWYxOGQ1YzRjZWMxNDhjYzdjOTg0MDNjM2RhOTJjZjljMmMwZDQ4Ng==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjBiZDY3MjFmM2EwMmNkMDlkOWUzNmIyYWZlNGI1OWI3NGNmYzNmYg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmZmNzgyMDQxZTVhNTBmNmM4ZDJiZmNkOTQ4MjRjOWU4YjhmOGUyMDkxZjU4
|
10
|
+
MGYwZDE5ZWZjYzg5ODQ5YzNjZjRjODhiOGVlOTk0YzZhYmQ1ZGI2MDY1NTA2
|
11
|
+
MDNjYTY2MzJiOTIwMjc0NWU0MzQ5NmM0OTE5ZjZjNmQzZWQ0MjQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDgxZGI3NGNmNGYwODM1NTYyYzE1NzY5YmViMzdkYTNjYTY3OGFhZjk3YzA4
|
14
|
+
NzAyMGI5YjU1YjY0MjM3Njc0MWRmOWIwNzljNWU4OGM5NzhhZDVmNDBjNjI4
|
15
|
+
YWM3ZDdmOWIyZDcyMDM0YTczZDM5Y2YxNmI4N2I2OTZmMjQ1NWE=
|
data/lib/RaaSmain.rb
CHANGED
@@ -61,16 +61,16 @@ end
|
|
61
61
|
|
62
62
|
def usage
|
63
63
|
puts "\nUsage: #{$PROGRAM_NAME} operation [option1] [option2]\n"
|
64
|
-
puts "\n\toperations: peers|replications|testfailover|testcleanup|failover"
|
64
|
+
puts "\n\toperations: peers|replications|testfailover[or test]|testcleanup[or cleanuptest]|failover[or recovery]"
|
65
65
|
puts "\n\te.g. #{$PROGRAM_NAME} peers"
|
66
66
|
puts "\te.g. #{$PROGRAM_NAME} replications ALL"
|
67
67
|
puts "\te.g. #{$PROGRAM_NAME} replications <VM name>"
|
68
|
-
puts "\te.g. #{$PROGRAM_NAME} testfailover <VM name>"
|
69
|
-
puts "\te.g. #{$PROGRAM_NAME} testfailover ALL"
|
70
|
-
puts "\te.g. #{$PROGRAM_NAME} testcleanup <VM name>"
|
71
|
-
puts "\te.g. #{$PROGRAM_NAME} testcleanup ALL"
|
72
|
-
puts "\te.g. #{$PROGRAM_NAME} failover <VM name>"
|
73
|
-
puts "\te.g. #{$PROGRAM_NAME} failover ALL"
|
68
|
+
puts "\te.g. #{$PROGRAM_NAME} testfailover [or test] <VM name>"
|
69
|
+
puts "\te.g. #{$PROGRAM_NAME} testfailover [or test] ALL"
|
70
|
+
puts "\te.g. #{$PROGRAM_NAME} testcleanup [or cleanuptest] <VM name>"
|
71
|
+
puts "\te.g. #{$PROGRAM_NAME} testcleanup [or cleanuptest] cleanuptest ALL"
|
72
|
+
puts "\te.g. #{$PROGRAM_NAME} failover [or recovery] <VM name>"
|
73
|
+
puts "\te.g. #{$PROGRAM_NAME} failover [or recovery] recovery ALL"
|
74
74
|
puts "\n"
|
75
75
|
|
76
76
|
end
|
@@ -78,9 +78,11 @@ end
|
|
78
78
|
|
79
79
|
# These are the variables the program accept as inputs (see the usage section for more info)
|
80
80
|
|
81
|
-
|
81
|
+
if ARGV[0]
|
82
|
+
$operation = ARGV[0].downcase
|
83
|
+
end
|
84
|
+
|
82
85
|
$details = ARGV[1]
|
83
|
-
$VM = ARGV[2]
|
84
86
|
|
85
87
|
# The if checks if the user called an operation. If not the case, we print the text on how to use the CLI
|
86
88
|
|
@@ -158,7 +160,7 @@ if $operation
|
|
158
160
|
# and print results or wants to testfailover one specific VM (in which case we call the testfailoverVM method)
|
159
161
|
# and print results
|
160
162
|
|
161
|
-
when 'testfailover'
|
163
|
+
when 'testfailover', 'test'
|
162
164
|
#if the keyword name "ALL is specified we test failover ALL VMs
|
163
165
|
if $details == "ALL"
|
164
166
|
print "Are you REALLY SURE you want to test failover ALL the VMs? (yes/no): ".red
|
@@ -169,17 +171,17 @@ if $operation
|
|
169
171
|
puts 'Performing a test failover of all VMs. This may be a long task. Please wait.'.green
|
170
172
|
puts "\n"
|
171
173
|
vmname, testfailover = raas.testfailoverALL
|
172
|
-
|
173
|
-
|
174
|
-
vmname.length.times do |i|
|
174
|
+
# Here we iterarte through the two arrays returned and print the VMs name and whether the testfailover was executed or not
|
175
|
+
vmname.length.times do |i|
|
175
176
|
if testfailover[i] == false
|
176
177
|
puts "Sorry, the VM ".red + vmname[i] + " is not in the proper state to test a failover".red
|
177
178
|
puts "\n"
|
178
179
|
else
|
179
180
|
puts "Performing a test failover of VM ".green + vmname[i] + ". Please wait.".green
|
180
181
|
puts "\n"
|
181
|
-
|
182
|
-
|
182
|
+
end # if #testfailover == false
|
183
|
+
end #do
|
184
|
+
end #if input == "yes"
|
183
185
|
else
|
184
186
|
if $details
|
185
187
|
# if the details parameter is specified we assume it's a VM name and we run testfailoverVM
|
@@ -207,7 +209,7 @@ if $operation
|
|
207
209
|
# and print results or wants to testcleanup one specific VM (in which case we call the testcleanupVM method)
|
208
210
|
# and print results
|
209
211
|
|
210
|
-
when 'testcleanup'
|
212
|
+
when 'testcleanup', 'cleanuptest'
|
211
213
|
#if the keyword name "ALL is specified we test cleanup ALL VMs
|
212
214
|
if $details == "ALL"
|
213
215
|
print "Are you REALLY SURE you want to clean up ALL the VMs? (yes/no): ".red
|
@@ -218,17 +220,17 @@ if $operation
|
|
218
220
|
puts 'Performing a test cleanup of all VMs. This may be a long task. Please wait.'.green
|
219
221
|
puts "\n"
|
220
222
|
vmname, testcleanup = raas.testcleanupALL
|
221
|
-
|
222
|
-
|
223
|
-
vmname.length.times do |i|
|
223
|
+
# Here we iterarte through the two arrays returned and print the VMs name and whether the testcleanup was executed or not
|
224
|
+
vmname.length.times do |i|
|
224
225
|
if testcleanup[i] == false
|
225
226
|
puts "Sorry, the VM ".red + vmname[i] + " is not in a test failover state that allows a clean up".red
|
226
227
|
puts "\n"
|
227
228
|
else
|
228
229
|
puts "Performing a testcleanup of VM ".green + vmname[i] + ". Please wait.".green
|
229
230
|
puts "\n"
|
230
|
-
|
231
|
-
|
231
|
+
end #if testcleanup == false
|
232
|
+
end #do
|
233
|
+
end #if input == "yes"
|
232
234
|
else
|
233
235
|
if $details
|
234
236
|
# if the details parameter is specified we assume it's a VM name and we run testcleanupVM
|
@@ -256,7 +258,7 @@ if $operation
|
|
256
258
|
# and print results or wants to failover one specific VM (in which case we call the failoverVM method)
|
257
259
|
# and print results
|
258
260
|
|
259
|
-
when 'failover'
|
261
|
+
when 'failover', 'recovery'
|
260
262
|
#if the keyword name "ALL is specified we failover ALL VMs
|
261
263
|
if $details == "ALL"
|
262
264
|
print "Are you REALLY SURE you want to failover ALL the VMs for production usage? (yes/no): ".red
|
@@ -265,17 +267,17 @@ if $operation
|
|
265
267
|
puts 'Performing a failover of all VMs. This may be a long task. Please wait.'.green
|
266
268
|
puts "\n"
|
267
269
|
vmname, failover = raas.failoverALL
|
268
|
-
|
269
|
-
|
270
|
-
vmname.length.times do |i|
|
270
|
+
# Here we iterarte through the two arrays returned and print the VMs name and whether the failover was executed or not
|
271
|
+
vmname.length.times do |i|
|
271
272
|
if failover[i] == false
|
272
273
|
puts "Sorry, the VM ".red + vmname[i] + " is not in the proper state to failover".red
|
273
274
|
puts "\n"
|
274
275
|
else
|
275
276
|
puts "Performing a failover of VM ".green + vmname[i] + ". Please wait.".green
|
276
277
|
puts "\n"
|
277
|
-
|
278
|
-
|
278
|
+
end # if failover == false
|
279
|
+
end #do
|
280
|
+
end #if input == "yes"
|
279
281
|
else
|
280
282
|
if $details
|
281
283
|
# if the details parameter is specified we assume it's a VM name and we run failoverVM
|