Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mediaserver
envsetup
Commits
c19472a2
Commit
c19472a2
authored
3 years ago
by
Stéphane Diemer
Browse files
Options
Downloads
Patches
Plain Diff
Use socket.getfqdn instead of hostname -f in test_email | refs
#33810
parent
b7f109c5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/scripts/test_email.py
+4
-7
4 additions, 7 deletions
tests/scripts/test_email.py
with
4 additions
and
7 deletions
tests/scripts/test_email.py
+
4
−
7
View file @
c19472a2
...
...
@@ -19,7 +19,6 @@ sys.path.append(str(Path(__file__).parents[1].resolve()))
# pylint: disable=wrong-import-position
from
utilities
import
logging
as
lg
# noqa: E402
from
utilities.commands
import
exec_cmd
# noqa: E402
from
utilities.config
import
load_conf
# noqa: E402
from
utilities.network
import
get_ip
# noqa: E402
...
...
@@ -81,12 +80,10 @@ def check_relay(relay_host: str, relay_port: str, domain: str) -> tuple:
out
=
subprocess
.
getoutput
(
"
grep -E
'
^myorigin
'
/etc/postfix/main.cf
"
)
myorigin
=
out
.
replace
(
"
myorigin
"
,
""
).
strip
()
# possible origin names
origins
=
set
(
(
domain
or
None
,
exec_cmd
(
"
hostname
"
,
log_output
=
False
)[
1
]
or
None
,
exec_cmd
(
"
hostname -f
"
,
log_output
=
False
)[
1
]
or
None
,
)
origins
=
(
domain
or
None
,
socket
.
gethostname
(),
socket
.
getfqdn
(),
)
if
myorigin
not
in
origins
:
lg
.
warning
(
'"
myorigin
"
setting does not contain a valid domain
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment