mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fixed comparison of None
with constants
There are comparisons of `None` with constant values (e.g. `'size' is None`) resulting in the comparison always being `True` or `False`. I replaced the constant values with variable names. I work for Semmle and I noticed these issues with out LGTM code analyzer https://lgtm.com/projects/g/saltstack/salt/alerts/?mode=tree&ruleFocus=3980086
This commit is contained in:
parent
7ab1281a7d
commit
b4e31837af
2 changed files with 3 additions and 3 deletions
|
@ -1828,7 +1828,7 @@ def create_disk(kwargs=None, call=None):
|
|||
)
|
||||
return False
|
||||
|
||||
if 'size' is None and 'image' is None and 'snapshot' is None:
|
||||
if size is None and image is None and snapshot is None:
|
||||
log.error(
|
||||
'Must specify image, snapshot, or size.'
|
||||
)
|
||||
|
|
|
@ -1256,9 +1256,9 @@ def edit_team(name,
|
|||
parameters = {}
|
||||
if name is not None:
|
||||
parameters['name'] = name
|
||||
if 'description' is not None:
|
||||
if description is not None:
|
||||
parameters['description'] = description
|
||||
if 'privacy' is not None:
|
||||
if privacy is not None:
|
||||
parameters['privacy'] = privacy
|
||||
if permission is not None:
|
||||
parameters['permission'] = permission
|
||||
|
|
Loading…
Add table
Reference in a new issue