Fix a use of in where it should be equality

The pattern for most other comparisons against name_or_id are if
name_or_id in (name, id) - but in this case, because we're doing the
name exclusion parameter as well, we split them. However, we kept the
in, even though it should be testing for equality. This can cause some
failures that make people sad.

Change-Id: If33bfe5c1e32b36c27c32cfcba4c07dcf01a4e74
This commit is contained in:
Monty Taylor 2015-03-30 18:07:46 -04:00
parent 0dc9165708
commit 1bd2a10cc0

View File

@ -753,7 +753,7 @@ class OpenStackCloud(object):
if image_id == name_or_id:
return image
if (image is not None and
name_or_id in image.name and (
name_or_id == image.name and (
not exclude or exclude not in image.name)):
return image
return None