mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-04 15:34:01 -07:00
Fix linting errors; fix some real bugs (#5111)
* Fix linting errors. * Fix bugs. * Another linter error ignored. * More fixes. * Ignore sanity errors with older versions. ci_complete * Forgot to commit more changes.
This commit is contained in:
parent
0338eb7a7c
commit
a54af8909c
52 changed files with 115 additions and 94 deletions
|
|
@ -363,7 +363,7 @@ def format_disk_size(size_bytes, unit):
|
|||
This function has been adapted from https://github.com/Distrotech/parted/blo
|
||||
b/279d9d869ff472c52b9ec2e180d568f0c99e30b0/libparted/unit.c
|
||||
"""
|
||||
global units_si, units_iec
|
||||
global units_si, units_iec # pylint: disable=global-variable-not-assigned
|
||||
|
||||
unit = unit.lower()
|
||||
|
||||
|
|
@ -459,7 +459,7 @@ def get_device_info(device, unit):
|
|||
Fetches information about a disk and its partitions and it returns a
|
||||
dictionary.
|
||||
"""
|
||||
global module, parted_exec
|
||||
global module, parted_exec # pylint: disable=global-variable-not-assigned
|
||||
|
||||
# If parted complains about missing labels, it means there are no partitions.
|
||||
# In this case only, use a custom function to fetch information and emulate
|
||||
|
|
@ -486,7 +486,7 @@ def check_parted_label(device):
|
|||
to 3.1 don't return data when there is no label. For more information see:
|
||||
http://upstream.rosalinux.ru/changelogs/libparted/3.1/changelog.html
|
||||
"""
|
||||
global parted_exec
|
||||
global parted_exec # pylint: disable=global-variable-not-assigned
|
||||
|
||||
# Check the version
|
||||
parted_major, parted_minor, dummy = parted_version()
|
||||
|
|
@ -532,7 +532,7 @@ def parted_version():
|
|||
"""
|
||||
Returns the major and minor version of parted installed on the system.
|
||||
"""
|
||||
global module, parted_exec
|
||||
global module, parted_exec # pylint: disable=global-variable-not-assigned
|
||||
|
||||
rc, out, err = module.run_command("%s --version" % parted_exec)
|
||||
if rc != 0:
|
||||
|
|
@ -551,7 +551,7 @@ def parted(script, device, align):
|
|||
"""
|
||||
Runs a parted script.
|
||||
"""
|
||||
global module, parted_exec
|
||||
global module, parted_exec # pylint: disable=global-variable-not-assigned
|
||||
|
||||
align_option = '-a %s' % align
|
||||
if align == 'undefined':
|
||||
|
|
@ -602,7 +602,7 @@ def check_size_format(size_str):
|
|||
|
||||
|
||||
def main():
|
||||
global module, units_si, units_iec, parted_exec
|
||||
global module, units_si, units_iec, parted_exec # pylint: disable=global-variable-not-assigned
|
||||
|
||||
changed = False
|
||||
output_script = ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue