Skip to content

Commit

Permalink
Fix string value comparision
Browse files Browse the repository at this point in the history
  • Loading branch information
wheatdog authored and yunchih committed Oct 1, 2017
1 parent b3d51ff commit 422f34c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resrc/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ def check_rules(self, rules):

def translate_rule(self, name, v):
p = self.percent(v)
if name is "CPUQuota":
if name == "CPUQuota":
# CPUQuota 1% = CPUQuotaPerSecUSec 10000
return ("CPUQuotaPerSecUSec", (p * 1000000.0))
if name is "CPUQuotaOverall":
if name == "CPUQuotaOverall":
return ("CPUQuotaPerSecUSec", int(self.cpu_cnt * p * 1000000.0))
if "Memory" in name and "%" in v:
return (name, int(self.ram_bytes * p))
Expand Down

0 comments on commit 422f34c

Please sign in to comment.