Browse Source

* Replace asserts with raises

Jhon Honce 10 năm trước cách đây
mục cha
commit
14b19e665b
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      bin/cluster

+ 2 - 2
bin/cluster

@@ -43,7 +43,7 @@ class Cluster(object):
             inventory = '-i inventory/aws/ec2.py'
         else:
             # this code should never be reached
-            assert False, "invalid PROVIDER {}".format(self.args.provider)
+            raise argparse.ArgumentError("invalid PROVIDER {}".format(self.args.provider))
 
         env = {'cluster_id': self.args.cluster_id}
 
@@ -62,7 +62,7 @@ class Cluster(object):
             raise argparse.ArgumentError("ACTION {} not implemented".format(self.args.action))
         else:
             # this code should never be reached
-            assert False, "invalid ACTION {}".format(self.args.action)
+            raise argparse.ArgumentError("invalid ACTION {}".format(self.args.action))
 
         verbose = ''
         if self.args.verbose > 0: