diff --git a/cueadmin/cueadmin/common.py b/cueadmin/cueadmin/common.py index 96dfa128e..850b29b3f 100644 --- a/cueadmin/cueadmin/common.py +++ b/cueadmin/cueadmin/common.py @@ -204,8 +204,10 @@ def getParser(): sub.add_argument("-size", action="store", nargs=3, metavar="SHOW ALLOC SIZE", help="Set the guaranteed number of cores.") sub.add_argument("-burst", action="store", nargs=3, metavar="SHOW ALLOC BURST", - help="Set the number of burst cores. Use the percent sign to indicate a " - "percentage of the subscription size instead of a hard size.") + help="Set the number of burst cores for a subscription passing: " + " show allocation value" + "Use the percent sign in value to indicate a percentage " + "of the subscription size instead of a hard size.") # # Host # @@ -798,15 +800,15 @@ def setUpState(hosts_): elif args.size: sub_name = "%s.%s" % (args.size[1], args.size[0]) - opencue.api.findSubscription(sub_name).setSize(float(args.size[2])) + opencue.api.findSubscription(sub_name).setSize(int(args.size[2])) elif args.burst: sub_name = "%s.%s" % (args.burst[1], args.burst[0]) sub = opencue.api.findSubscription(sub_name) burst = args.burst[2] - if burst.find("%") !=-1: + if burst.find("%") != -1: burst = int(sub.data.size + (sub.data.size * (int(burst[0:-1]) / 100.0))) - sub.setBurst(float(burst)) + sub.setBurst(int(burst)) def createAllocation(fac, name, tag): diff --git a/pycue/opencue/wrappers/subscription.py b/pycue/opencue/wrappers/subscription.py index 671866f69..25aa6c23e 100644 --- a/pycue/opencue/wrappers/subscription.py +++ b/pycue/opencue/wrappers/subscription.py @@ -44,11 +44,13 @@ def get(self, id): return Subscription(response.subscription) def setSize(self, size): + assert (isinstance(size, int)), "size is not expected type: int" self.stub.SetSize( subscription_pb2.SubscriptionSetSizeRequest(subscription=self.data, new_size=size), timeout=Cuebot.Timeout) def setBurst(self, burst): + assert (isinstance(burst, int)), "burst is not expected type: int" self.stub.SetBurst( subscription_pb2.SubscriptionSetBurstRequest(subscription=self.data, burst=burst), timeout=Cuebot.Timeout)