RaaS 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/RaaSmain.rb +29 -27
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NGJiMmMwYTNiNmE0ZmQyYTBjYTFjMTE0NTYxZmY2YmY0NWFkMThkZA==
4
+ OWYxOGQ1YzRjZWMxNDhjYzdjOTg0MDNjM2RhOTJjZjljMmMwZDQ4Ng==
5
5
  data.tar.gz: !binary |-
6
- MjU5MDEzOTI5ZWU1ZjcxMzdkNDI3NDViNmVkNmRmOTczN2VjNTViMw==
6
+ ZjBiZDY3MjFmM2EwMmNkMDlkOWUzNmIyYWZlNGI1OWI3NGNmYzNmYg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDViMDdjNjI0NDU3MGZlMjcxZjAyMDQ1NTRjYTZmZmIzYzc4MTE2ZTU5MTMw
10
- NzY2MWQ4NzE0ODk0YjcyZWI4MWYyODczMzliZmRiOGIxMGJmMjJmMmQwZDU5
11
- MWU0YzQ2ZDZlYTkzZDg2NmI5Y2MzNzViMmFhMmEwOWU5NDA1Nzk=
9
+ YmZmNzgyMDQxZTVhNTBmNmM4ZDJiZmNkOTQ4MjRjOWU4YjhmOGUyMDkxZjU4
10
+ MGYwZDE5ZWZjYzg5ODQ5YzNjZjRjODhiOGVlOTk0YzZhYmQ1ZGI2MDY1NTA2
11
+ MDNjYTY2MzJiOTIwMjc0NWU0MzQ5NmM0OTE5ZjZjNmQzZWQ0MjQ=
12
12
  data.tar.gz: !binary |-
13
- YTYwNGY2MjhjOTQxNDQ1NTAxODM3OTk3ODI1ZDk0YzI2ZTgwYWJhZWE4YWYx
14
- OGY3YmZlZWNhMzgyZTE1MzliN2Y2ZjMxZDcyZDVhZGQ4ODNjMTU4NzMzNjIy
15
- NGQyYmE5ZmYyZmEwMTQ1MTU4YTJhZDlhZjNjZThiYWUzM2JjYTU=
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
- $operation = ARGV[0]
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
- end
173
- # Here we iterarte through the two arrays returned and print the VMs name and whether the testfailover was executed or not
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
- end # if
182
- end #do
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
- end
222
- # Here we iterarte through the two arrays returned and print the VMs name and whether the testcleanup was executed or not
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
- end #if
231
- end #do
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
- end
269
- # Here we iterarte through the two arrays returned and print the VMs name and whether the failover was executed or not
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
- end # if
278
- end #do
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: RaaS
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Massimo Re Ferrè