Skip to content

Commit 60d2679

Browse files
committed
fix missing imports and undefined variables according to pylint
1 parent a07d42a commit 60d2679

File tree

3 files changed

+27
-21
lines changed

3 files changed

+27
-21
lines changed

repos/system_upgrade/common/actors/checketcreleasever/libraries/checketcreleasever.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from leapp import reporting
22
from leapp.libraries.stdlib import api
33
from leapp.models import PkgManagerInfo, RHUIInfo
4+
from leapp.libraries.common.config.version import get_target_major_version
45

56

67
def handle_etc_releasever():

repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py

+21-21
Original file line numberDiff line numberDiff line change
@@ -66,27 +66,27 @@ def process7to8(self, config):
6666
if not config.permit_root_login:
6767
add_permitrootlogin_conf()
6868
create_report([
69-
reporting.Title('SSH configuration automatically modified to permit root login'),
70-
reporting.Summary(
71-
'Your OpenSSH configuration file does not explicitly state '
72-
'the option PermitRootLogin in sshd_config file. '
73-
'Its default is "yes" in RHEL7, but will change in '
74-
'RHEL8 to "prohibit-password", which may affect your ability '
75-
'to log onto this machine after the upgrade. '
76-
'To prevent this from occuring, the PermitRootLogin option '
77-
'has been explicity set to "yes" to preserve the default behaivour '
78-
'after migration. '
79-
'The original configuration file has been backed up to '
80-
'/etc/ssh/sshd_config.leapp_backup'
81-
),
82-
reporting.Severity(reporting.Severity.MEDIUM),
83-
reporting.Groups(COMMON_REPORT_TAGS),
84-
reporting.Remediation(
85-
hint='If you would prefer to configure the root login policy yourself, '
86-
'consider setting the PermitRootLogin option '
87-
'in sshd_config explicitly.'
88-
)
89-
] + resources)
69+
reporting.Title('SSH configuration automatically modified to permit root login'),
70+
reporting.Summary(
71+
'Your OpenSSH configuration file does not explicitly state '
72+
'the option PermitRootLogin in sshd_config file. '
73+
'Its default is "yes" in RHEL7, but will change in '
74+
'RHEL8 to "prohibit-password", which may affect your ability '
75+
'to log onto this machine after the upgrade. '
76+
'To prevent this from occuring, the PermitRootLogin option '
77+
'has been explicity set to "yes" to preserve the default behaivour '
78+
'after migration. '
79+
'The original configuration file has been backed up to '
80+
'/etc/ssh/sshd_config.leapp_backup'
81+
),
82+
reporting.Severity(reporting.Severity.MEDIUM),
83+
reporting.Groups(COMMON_REPORT_TAGS),
84+
reporting.Remediation(
85+
hint='If you would prefer to configure the root login policy yourself, '
86+
'consider setting the PermitRootLogin option '
87+
'in sshd_config explicitly.'
88+
)
89+
] + COMMON_RESOURCES)
9090
return
9191

9292
# Check if there is at least one PermitRootLogin other than "no"

repos/system_upgrade/common/actors/opensshpermitrootlogincheck/libraries/opensshpermitrootlogincheck.py

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import errno
2+
from leapp.libraries.stdlib import api
3+
4+
15
def global_value(config, default):
26
"""
37
Find the global value for PermitRootLogin option in sshd_config.
@@ -42,6 +46,7 @@ def semantics_changes(config):
4246

4347
return config_global_value is None and not in_match_enabled
4448

49+
4550
def add_permitrootlogin_conf():
4651
CONFIG = '/etc/ssh/sshd_config'
4752
CONFIG_BACKUP = '/etc/ssh/sshd_config.leapp_backup'

0 commit comments

Comments
 (0)