Raise on invalid gnt-cluster queue commands
authorGuido Trotter <ultrotter@google.com>
Fri, 20 Mar 2009 13:06:29 +0000 (13:06 +0000)
committerGuido Trotter <ultrotter@google.com>
Fri, 20 Mar 2009 13:06:29 +0000 (13:06 +0000)
 # gnt-cluster queue foo
 Failure: prerequisites not met for this operation:
 Command 'foo' is not valid.

Reviewed-by: iustinp

scripts/gnt-cluster

index 928e0ac..b0309c0 100755 (executable)
@@ -506,6 +506,9 @@ def QueueOps(opts, args):
     else:
       val = "unset"
     ToStdout("The drain flag is %s" % val)
     else:
       val = "unset"
     ToStdout("The drain flag is %s" % val)
+  else:
+    raise errors.OpPrereqError("Command '%s' is not valid." % command)
+
   return 0
 
 # this is an option common to more than one command, so we declare
   return 0
 
 # this is an option common to more than one command, so we declare