Skip to content

Commit

Permalink
Support integer target value in the keyval inputs
Browse files Browse the repository at this point in the history
Don't suppose the target is always a string. The forms can format integer
targets too.
  • Loading branch information
cvaroqui committed Sep 29, 2017
1 parent c2b9a0e commit e34f2de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions var/compliance/com.opensvc/keyval.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def _check_key(self, path, data, keyname, target, op, value, instance=0, verbose
return RET_OK
elif op == "unset":
if value is not None:
if target.strip() == "":
if is_string(target) and target.strip() == "":
if verbose:
perror("%s is set, should not be"%keyname)
return RET_ERR
Expand All @@ -166,7 +166,7 @@ def _check_key(self, path, data, keyname, target, op, value, instance=0, verbose
pinfo("%s is not set to value %s, on target"%(keyname, target))
return RET_OK
else:
if target.strip() != "":
if is_string(target) and target.strip() != "":
if verbose:
pinfo("%s=%s is not set, on target"%(keyname, target))
else:
Expand Down

0 comments on commit e34f2de

Please sign in to comment.