2017-02-27 12:56:24 +01:00
|
|
|
Index: cloud-init-0.7.8/cloudinit/distros/__init__.py
|
|
|
|
===================================================================
|
|
|
|
--- cloud-init-0.7.8.orig/cloudinit/distros/__init__.py
|
|
|
|
+++ cloud-init-0.7.8/cloudinit/distros/__init__.py
|
|
|
|
@@ -504,8 +504,11 @@ class Distro(object):
|
2014-09-17 09:17:45 +02:00
|
|
|
# about long names.
|
|
|
|
util.subp(['passwd', '-l', name])
|
|
|
|
except Exception as e:
|
|
|
|
- util.logexc(LOG, 'Failed to disable password for user %s', name)
|
|
|
|
- raise e
|
|
|
|
+ if e.exit_code != 3:
|
|
|
|
+ util.logexc(LOG, 'Failed to disable password for user %s', name)
|
|
|
|
+ raise e
|
|
|
|
+ else:
|
|
|
|
+ util.logexc(LOG, 'Password access already locked for user %s', name)
|
|
|
|
|
|
|
|
def set_passwd(self, user, passwd, hashed=False):
|
|
|
|
pass_string = '%s:%s' % (user, passwd)
|