Added fix for CWE 398: Code Quality
Change-Id: Ie86246c6606bc5fd12d00b297a5b19661747baa7
Signed-off-by: 36970 <jegan.s@tataelxsi.co.in>
"""Returns id of name, or the id itself if given as argument"""
self._logger.debug("")
for sdnc in self.list():
- if name == sdnc["_id"]:
- return sdnc["_id"]
- for sdnc in self.list():
- if name == sdnc["name"]:
+ if name == sdnc["_id"] or name == sdnc["name"]:
return sdnc["_id"]
return ""
self._logger.debug("")
self._client.get_token()
for vim in self.list():
- if name == vim["uuid"]:
- return vim["uuid"]
- for vim in self.list():
- if name == vim["name"]:
+ if name == vim["uuid"] or name == vim["name"]:
return vim["uuid"]
return ""
"""Returns id of name, or the id itself if given as argument"""
self._logger.debug("")
for wim in self.list():
- if name == wim["uuid"]:
- return wim["uuid"]
- for wim in self.list():
- if name == wim["name"]:
+ if name == wim["uuid"] or name == wim["name"]:
return wim["uuid"]
return ""