Replace assert with condition

a piece of code in image client has some business logic behind
assert, which can be lost when running python in optimized mode (-O).

Change-Id: I2179970df495e1215d691915c51cebe5cb4541a7
This commit is contained in:
Pavlo Shchelokovskyy 2018-01-22 12:24:01 +02:00
parent e8b56a37cc
commit ca90985f4e
1 changed files with 1 additions and 3 deletions

View File

@ -1024,9 +1024,7 @@ class UnsetImage(command.Command):
if parsed_args.properties:
for k in parsed_args.properties:
try:
assert(k in image.keys())
except AssertionError:
if k not in image:
LOG.error(_("property unset failed, '%s' is a "
"nonexistent property "), k)
propret += 1