diff options
author | Scott Moser <smoser@ubuntu.com> | 2014-02-13 21:18:17 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2014-02-13 21:18:17 -0500 |
commit | 4ba72556193219f90c313f62d0d309761bb53c6b (patch) | |
tree | 2ad80e184d53a85a1fe5933ad106249bc522da35 /cloudinit/config/cc_set_passwords.py | |
parent | 507aeed12312af7fc8a9fcfca6b845183a5a3c51 (diff) | |
parent | 053667688d7c2ad51e569c62e00dac1942e46f62 (diff) | |
download | vyos-cloud-init-4ba72556193219f90c313f62d0d309761bb53c6b.tar.gz vyos-cloud-init-4ba72556193219f90c313f62d0d309761bb53c6b.zip |
merge from trunk
Diffstat (limited to 'cloudinit/config/cc_set_passwords.py')
-rw-r--r-- | cloudinit/config/cc_set_passwords.py | 5 |
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: |