summaryrefslogtreecommitdiff
path: root/cloudinit/config
diff options
context:
space:
mode:
authorNate House <nathan.house@rackspace.com>2014-02-12 16:59:20 -0500
committerScott Moser <smoser@ubuntu.com>2014-02-12 16:59:20 -0500
commitf7ac086a434b511b076346839818de7cf34e18a2 (patch)
tree12fe7fee7d796964ab93d73b16d42e2157c0491d /cloudinit/config
parent5d2a31bd66fc5fc10901e30a2b9c79c7f4d1a172 (diff)
parent0b0bb4721c61015e3fce9b4030bcb69b9da5c368 (diff)
downloadvyos-cloud-init-f7ac086a434b511b076346839818de7cf34e18a2.tar.gz
vyos-cloud-init-f7ac086a434b511b076346839818de7cf34e18a2.zip
initial Gentoo and Arch linux support
Diffstat (limited to 'cloudinit/config')
-rw-r--r--cloudinit/config/cc_set_passwords.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/cloudinit/config/cc_set_passwords.py b/cloudinit/config/cc_set_passwords.py
index 56a36906..4a3b21af 100644
--- a/cloudinit/config/cc_set_passwords.py
+++ b/cloudinit/config/cc_set_passwords.py
@@ -136,9 +136,12 @@ def handle(_name, cfg, cloud, log, args):
util.write_file(ssh_util.DEF_SSHD_CFG, "\n".join(lines))
try:
- cmd = ['service']
+ cmd = cloud.distro.init_cmd # Default service
cmd.append(cloud.distro.get_option('ssh_svcname', 'ssh'))
cmd.append('restart')
+ if 'systemctl' in cmd: # Switch action ordering
+ cmd[1], cmd[2] = cmd[2], cmd[1]
+ cmd = filter(None, cmd) # Remove empty arguments
util.subp(cmd)
log.debug("Restarted the ssh daemon")
except: