diff options
author | Nicolas Bock <nicolas.bock@canonical.com> | 2020-09-10 15:01:29 -0600 |
---|---|---|
committer | Jake Hunsaker <jhunsake@redhat.com> | 2020-09-14 11:34:00 -0400 |
commit | 1a64629f270399f20c0b4aa66cfb1d28565f85f3 (patch) | |
tree | ac1710510623683b5b668b59df53b44679ccc138 | |
parent | 1b77ccf21a51f7711c6cbc090f108c50a81a5249 (diff) | |
download | sos-1a64629f270399f20c0b4aa66cfb1d28565f85f3.tar.gz |
[policies] Add snapped dockerd service
When the docker service is installed via snap then the systemd service
is called `snap.docker.dockerd.service` and the test whether the
service is running fails. This change adds the snap service name so
that the `DockerContainerRuntime` can detect it.
Resolves: #2230
Signed-off-by: Nicolas Bock <nicolas.bock@canonical.com>
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r-- | sos/policies/__init__.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sos/policies/__init__.py b/sos/policies/__init__.py index 39452c59..d8b77319 100644 --- a/sos/policies/__init__.py +++ b/sos/policies/__init__.py @@ -217,7 +217,8 @@ class DockerContainerRuntime(ContainerRuntime): def check_is_active(self): # the daemon must be running if (is_executable('docker') and - self.policy.init_system.is_running('docker')): + (self.policy.init_system.is_running('docker') or + self.policy.init_system.is_running('snap.docker.dockerd'))): self.active = True return True return False @@ -740,7 +741,7 @@ NO_PRESET_NOTE = 'Use to disable automatically loaded presets' GENERIC_PRESETS = { NO_PRESET: PresetDefaults(name=NO_PRESET, desc=NO_PRESET_DESC, note=NO_PRESET_NOTE, opts=SoSOptions()) - } +} class Policy(object): @@ -1096,7 +1097,7 @@ any third party. self._print(" " + self.get_preferred_hash_name() + "\t" + checksum) self._print() self._print(_("Please send this file to your support " - "representative.")) + "representative.")) self._print() def _print(self, msg=None, always=False): |