summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorBen Howard <ben.howard@canonical.com>2012-08-31 15:45:15 -0600
committerBen Howard <ben.howard@canonical.com>2012-08-31 15:45:15 -0600
commit5988d5987982a60e13a37639d93ee08ffeb71ffd (patch)
tree31a7672cf4304a8103f6ac5df422611e62b80aea /cloudinit
parent27118e7406237510ca56e969aa1b6d9152c8afbf (diff)
downloadvyos-cloud-init-5988d5987982a60e13a37639d93ee08ffeb71ffd.tar.gz
vyos-cloud-init-5988d5987982a60e13a37639d93ee08ffeb71ffd.zip
Removed admin group from default Ubuntu user group list.
Fixed change password behavior to work with new user list handling (LP: #1044553)
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/config/cc_set_passwords.py10
-rw-r--r--cloudinit/distros/ubuntu.py2
2 files changed, 8 insertions, 4 deletions
diff --git a/cloudinit/config/cc_set_passwords.py b/cloudinit/config/cc_set_passwords.py
index 7d0fbd9f..a017e6b6 100644
--- a/cloudinit/config/cc_set_passwords.py
+++ b/cloudinit/config/cc_set_passwords.py
@@ -53,14 +53,18 @@ def handle(_name, cfg, cloud, log, args):
user = cloud.distro.get_default_user()
if 'users' in cfg:
- user_zero = cfg['users'].keys()[0]
- if user_zero != "default":
- user = user_zero
+ user_zero = cfg['users'][0]
+
+ if isinstance(user_zero, dict) and 'name' in user_zero:
+ user = user_zero['name']
if user:
plist = "%s:%s" % (user, password)
+ else:
+ log.warn("No default or defined user to change password for.")
+
errors = []
if plist:
plist_in = []
diff --git a/cloudinit/distros/ubuntu.py b/cloudinit/distros/ubuntu.py
index 5444cbc0..22f8c2c5 100644
--- a/cloudinit/distros/ubuntu.py
+++ b/cloudinit/distros/ubuntu.py
@@ -31,5 +31,5 @@ class Distro(debian.Distro):
distro_name = 'ubuntu'
default_user = 'ubuntu'
- default_user_groups = ("adm,admin,audio,cdrom,dialout,floppy,video,"
+ default_user_groups = ("adm,audio,cdrom,dialout,floppy,video,"
"plugdev,dip,netdev,sudo")