Skip to content

Commit 1cb2458

Browse files
authored
Docstring refactoring: use quotes instead of apostrophe (oamg#616)
In case of docstring, quotes should be used always, officialy. Replace apostrophes by quotes in case of docstrings.
1 parent 9ac2b80 commit 1cb2458

22 files changed

Lines changed: 84 additions & 84 deletions

File tree

repos/system_upgrade/el7toel8/actors/detectgrubconfigerror/libraries/scanner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33

44
def detect_config_error(conf_file):
5-
'''
5+
"""
66
Check grub configuration for syntax error in GRUB_CMDLINE_LINUX value.
77
88
:return: Function returns True if error was detected, otherwise False.
9-
'''
9+
"""
1010
with open(conf_file, 'r') as f:
1111
config = f.read()
1212

repos/system_upgrade/el7toel8/actors/multipathconfcheck/actor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77

88
class MultipathConfCheck(Actor):
9-
'''
9+
"""
1010
Checks whether the multipath configuration can be updated to RHEL-8.
1111
Specifically, it checks if the path_checker/checker option is set to
1212
something other than tur in the defaults section. If so, non-trivial
1313
changes may be required in the multipath.conf file, and it is not
1414
possible to auto-update it.
15-
'''
15+
"""
1616

1717
name = 'multipath_conf_check'
1818
consumes = (MultipathConfFacts,)

repos/system_upgrade/el7toel8/actors/multipathconfread/actor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66

77
class MultipathConfRead(Actor):
8-
'''
8+
"""
99
Reads multipath configuration files (multipath.conf, and any files in
1010
the multipath config directory) and extracts the necessary information
11-
'''
11+
"""
1212

1313
name = 'multipath_conf_read'
1414
consumes = (InstalledRedHatSignedRPM,)

repos/system_upgrade/el7toel8/actors/multipathconfupdate/actor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66

77
class MultipathConfUpdate(Actor):
8-
'''
8+
"""
99
Modifies multipath configuration files on the target RHEL-8 system so that
1010
they will run properly. This is done in three ways
1111
1. commenting out lines for options that no longer exist, or whose value
1212
is no longer current in RHEL-8
1313
2. Migrating any options in an devices section with all_devs to an
1414
overrides setions
1515
3. Rename options that have changed names
16-
'''
16+
"""
1717

1818
name = 'multipath_conf_update'
1919
consumes = (MultipathConfFacts,)

repos/system_upgrade/el7toel8/actors/pcidevicesscanner/libraries/pcidevicesscanner.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
def parse_pci_device(block):
6-
''' Parse one block from lspci output describing one PCI device '''
6+
""" Parse one block from lspci output describing one PCI device """
77
device = {
88
'Slot': '',
99
'Class': '',
@@ -50,17 +50,17 @@ def parse_pci_device(block):
5050

5151

5252
def parse_pci_devices(output):
53-
''' Parse lspci output and return a list of PCI devices '''
53+
""" Parse lspci output and return a list of PCI devices """
5454
return [parse_pci_device(block) for block in output.split('\n\n')[:-1]]
5555

5656

5757
def produce_pci_devices(producer, devices):
58-
''' Produce a Leapp message with all PCI devices '''
58+
""" Produce a Leapp message with all PCI devices """
5959
producer(PCIDevices(devices=devices))
6060

6161

6262
def scan_pci_devices(producer):
63-
''' Scan system PCI Devices '''
63+
""" Scan system PCI Devices """
6464
output = run(['lspci', '-vmmk'], checked=False)['stdout']
6565
devices = parse_pci_devices(output)
6666
produce_pci_devices(producer, devices)

repos/system_upgrade/el7toel8/actors/selinux/selinuxapplycustom/actor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111

1212

1313
class SELinuxApplyCustom(Actor):
14-
'''
14+
"""
1515
Re-apply SELinux customizations from RHEL-7 installation
1616
1717
Re-apply SELinux policy customizations (custom policy modules and changes
1818
introduced by semanage). Any changes (due to incompatiblity with RHEL-8
1919
SELinux policy) are reported to user.
20-
'''
20+
"""
2121
name = 'selinuxapplycustom'
2222
consumes = (SELinuxCustom, SELinuxModules)
2323
produces = ()

repos/system_upgrade/el7toel8/actors/selinux/selinuxcontentscanner/actor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66

77
class SELinuxContentScanner(Actor):
8-
'''
8+
"""
99
Scan the system for any SELinux customizations
1010
1111
Find SELinux policy customizations (custom policy modules and changes
1212
introduced by semanage) and save them in SELinuxModules and SELinuxCustom
1313
models. Customizations that are incompatible with SELinux policy on RHEL-8
1414
are removed.
15-
'''
15+
"""
1616

1717
name = 'selinuxcontentscanner'
1818
consumes = (SELinuxFacts,)

repos/system_upgrade/el7toel8/actors/selinux/selinuxcontentscanner/libraries/selinuxcontentscanner.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131

3232

3333
def check_module(name):
34-
'''
34+
"""
3535
Check if given module contains one of removed types and comment out corresponding lines.
3636
3737
The function expects a text file "$name" containing cil policy
3838
to be present in the current directory.
3939
4040
Returns a list of invalid lines.
41-
'''
41+
"""
4242
try:
4343
removed = run(['grep', '-w', '-E', "|".join(REMOVED_TYPES_), name], split=True)
4444
# Add ";" at the beginning of invalid lines (comment them out)
@@ -49,11 +49,11 @@ def check_module(name):
4949

5050

5151
def list_selinux_modules():
52-
'''
52+
"""
5353
Produce list of SELinux policy modules
5454
5555
Returns list of tuples (name,priority)
56-
'''
56+
"""
5757
try:
5858
semodule = run(['semodule', '-lfull'], split=True)
5959
except CalledProcessError:
@@ -75,7 +75,7 @@ def list_selinux_modules():
7575

7676

7777
def get_selinux_modules():
78-
'''
78+
"""
7979
Read all custom SELinux policy modules from the system
8080
8181
Returns 3-tuple (modules, retain_rpms, install_rpms)
@@ -84,7 +84,7 @@ def get_selinux_modules():
8484
during the upgrade and "install_rpms" is a list of RPMs
8585
that should be installed during the upgrade
8686
87-
'''
87+
"""
8888

8989
modules = list_selinux_modules()
9090
semodule_list = []
@@ -172,15 +172,15 @@ def get_selinux_modules():
172172

173173

174174
def get_selinux_customizations():
175-
'''
175+
"""
176176
Extract local SELinux customizations introduced by semanage command
177177
178178
Returns tuple (semanage_valid, semanage_removed)
179179
where "semanage_valid" is a list of semanage commands
180180
which should be safe to re-apply on RHEL 8 system
181181
and "semanage_removed" is a list of commands that
182182
will no longer be valid after system upgrade
183-
'''
183+
"""
184184

185185
semanage_removed = []
186186
semanage_valid = []

repos/system_upgrade/el7toel8/actors/selinux/selinuxprepare/actor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66

77
class SELinuxPrepare(Actor):
8-
'''
8+
"""
99
Remove selinux policy customizations before updating selinux-policy* packages
1010
1111
RHEL-7 policy customizations could cause policy package upgrade to fail and therefore
1212
need to be removed. Customizations introduced by semanage are removed first,
1313
followed by custom policy modules gathered by SELinuxContentScanner.
14-
'''
14+
"""
1515

1616
name = 'selinuxprepare'
1717
consumes = (SELinuxCustom, SELinuxModules)

repos/system_upgrade/el7toel8/actors/sssdcheck/actor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414

1515

1616
class SSSDCheck(Actor):
17-
'''
17+
"""
1818
Check SSSD configuration for changes in RHEL8 and report them.
1919
2020
These changes are:
2121
- id_provider=local is no longer supported and will be ignored
2222
- ldap_groups_use_matching_rule_in_chain was removed and will be ignored
2323
- ldap_initgroups_use_matching_rule_in_chain was removed and will be ignored
2424
- ldap_sudo_include_regexp changed default from true to false
25-
'''
25+
"""
2626

2727
name = 'sssd_check'
2828
consumes = (SSSDConfig,)

0 commit comments

Comments
 (0)