Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New version of flake8 found some errors #3488

Merged
merged 1 commit into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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