Skip to content

Commit

Permalink
Prefer resolvectl over systemd-resolve
Browse files Browse the repository at this point in the history
The latter is a deprecated compat symlink.

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=979264

Signed-off-by: Michael Biebl <biebl@debian.org>
  • Loading branch information
mbiebl committed Jan 26, 2021
1 parent 3973d0d commit 818eaf8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sos/report/plugins/systemd.py
Expand Up @@ -47,11 +47,13 @@ def setup(self):
"timedatectl"

This comment has been minimized.

Copy link
@slashdd

slashdd Jan 26, 2021

Missing from sos.utilities import is_executable

])

# systemd-resolve command starts systemd-resolved service if that
# resolvectl command starts systemd-resolved service if that
# is not running, so gate the commands by this predicate
resolvectl = 'resolvectl' if self.is_executable('resolvectl') \

This comment has been minimized.

Copy link
@slashdd

slashdd Jan 26, 2021

sos_logs/systemd-plugin-errors.txt:
resolvectl = 'resolvectl' if self.is_executable('resolvectl') else 'systemd-resolve'
AttributeError: 'Systemd' object has no attribute 'is_executable'

Removing the self fixes the situation with the right import see above comment

else 'systemd-resolve'
self.add_cmd_output([
"systemd-resolve --status",
"systemd-resolve --statistics",
"%s status" % resolvectl,
"%s statistics" % resolvectl,

This comment has been minimized.

Copy link
@slashdd

slashdd Jan 26, 2021

Missing the -- whensystemd-resolve command is exercised.

sos_commands/systemd/systemd-resolve_statistics
::::::::::::::
statistics: resolve call failed: 'statistics' not found
::::::::::::::
sos_commands/systemd/systemd-resolve_status
::::::::::::::
status: resolve call failed: 'status' not found

], pred=SoSPredicate(self, services=["systemd-resolved"]))

self.add_cmd_output("systemd-analyze plot",
Expand Down

1 comment on commit 818eaf8

@mbiebl
Copy link
Contributor Author

@mbiebl mbiebl commented on 818eaf8 Jan 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really familiar with either Python or sosreport, so I'll guess I'll leave the more elaborate fix up to someone else.

Please sign in to comment.