Skip to content

Commit

Permalink
New version of flake8 found some errors (#3488)
Browse files Browse the repository at this point in the history
* Version 5.0.2 of flake8 detected some errors that needed
  to be fixed to allow CI/CD tests to pass

Signed-off-by: Bob Fahr <[email protected]>
(cherry picked from commit 4e6611a)
  • Loading branch information
bfahr authored and lhuett committed Aug 1, 2022
1 parent 99d0b62 commit 8318b60
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion insights/client/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def largest_spec_in_archive(archive_file):
abs_fname = os.path.join('.', data_top, fname)
# get the archives from inside data directory
data_file = tar_file.getmember(abs_fname)
if(data_file.size > largest_fsize):
if (data_file.size > largest_fsize):
largest_fsize = data_file.size
largest_file_name = fname
largest_spec = specs_metadata["name"]
Expand Down
2 changes: 1 addition & 1 deletion insights/parsers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def calc_offset(lines, target, invert_search=False, require_all=False):
return offset
else:
return offset
elif invert_search and not(line == '' or found_any):
elif invert_search and not (line == '' or found_any):
return offset

# If we get here then we didn't find any of the targets
Expand Down
2 changes: 1 addition & 1 deletion insights/parsers/passenger_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def parse_content(self, content):
group_list['p_list'].append(p_dict)
l = line.lstrip('* ')
# parse each key: value pair
while(':' in l and l.index(':') != l.rindex(':')):
while (':' in l and l.index(':') != l.rindex(':')):
k, l = [i.strip() for i in l.split(':', 1)]
v, l = [i.strip() for i in l.split(None, 1)]
p_dict[k] = v
Expand Down
2 changes: 1 addition & 1 deletion insights/parsers/sealert.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def lines_stripped(self):
lines = self.lines[:]
for index in range(len(self.lines) - 1, -1, -1):
if lines[index] == '':
del(lines[index])
del (lines[index])
else:
break
return lines
Expand Down
2 changes: 1 addition & 1 deletion insights/parsers/uname.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def __ne__(self, other):
See the `__eq__` operator for a detailed description.
"""
return not(self == other)
return not (self == other)

def __lt__(self, other):
"""
Expand Down
4 changes: 2 additions & 2 deletions insights/tests/parsers/test_satellite_postgresql_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ def test_basic_output_with_satellite_admin_setting():

def test_satellite_admin_settings():
settings = satellite_postgresql_query.SatelliteAdminSettings(context_wrap(SATELLITE_SETTINGS_2))
assert(len(settings)) == 2
assert (len(settings)) == 2
assert not settings.get_setting('unregister_delete_host')
assert settings.get_setting('destroy_vm_on_host_delete')

settings = satellite_postgresql_query.SatelliteAdminSettings(context_wrap(SATELLITE_SETTINGS_3))
assert(len(settings)) == 2
assert (len(settings)) == 2
assert not settings.get_setting('unregister_delete_host')
assert not settings.get_setting('destroy_vm_on_host_delete')
assert settings.get_setting('non_exist_column') is None
Expand Down

0 comments on commit 8318b60

Please sign in to comment.