summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorPavlo Shchelokovskyy <shchelokovskyy@gmail.com>2018-01-22 12:24:01 +0200
committerPavlo Shchelokovskyy <shchelokovskyy@gmail.com>2018-01-22 12:26:17 +0200
commitca90985f4e5e4ebcf97afd6cce38932e73120255 (patch)
treed11598b2e54fbd69f57429af0bbf56fbbcf36752 /openstackclient
parente8b56a37ccfcfeb5f12e873c8b58ba289e244870 (diff)
downloadpython-openstackclient-ca90985f4e5e4ebcf97afd6cce38932e73120255.tar.gz
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
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/image/v2/image.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py
index d793c459..0b8647a0 100644
--- a/openstackclient/image/v2/image.py
+++ b/openstackclient/image/v2/image.py
@@ -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