Skip to content

Commit

Permalink
Fix imports and linters
Browse files Browse the repository at this point in the history
  • Loading branch information
matejmatuska committed Aug 22, 2022
1 parent cc70877 commit f3b71a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions leapp/utils/workarounds/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import leapp.utils.workarounds.mp
import leapp.utils.workarounds.fqdn


def apply_workarounds():
Expand Down
6 changes: 3 additions & 3 deletions leapp/utils/workarounds/fqdn.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import re
import socket


def decorate_getfqdn(fn):
def wrap(*args, **kwargs):
result = fn(*args, **kwargs);
result = fn(*args, **kwargs)
# check whether FQDN conforms to standard, see HOSTNAME(7)
pattern = r"^(([a-z0-9]|[a-z0-9\-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])$"
if re.match(pattern, result, re.IGNORECASE):
return result
else:
return 'invalid.hostname'
return 'invalid.hostname'

return wrap

Expand Down

0 comments on commit f3b71a8

Please sign in to comment.