summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_users_groups.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-09-21 15:12:11 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-09-21 15:12:11 -0700
commit009faa0546ffbcadbbcaa9692d6842890e6f2e10 (patch)
tree715d284470c0047a54a58d430de1317376557321 /cloudinit/config/cc_users_groups.py
parent47d9df78264625207342e668a9120fa84b6ad355 (diff)
downloadvyos-cloud-init-009faa0546ffbcadbbcaa9692d6842890e6f2e10.tar.gz
vyos-cloud-init-009faa0546ffbcadbbcaa9692d6842890e6f2e10.zip
Fix some docs + pylint warnings + log on default created in the module.
Diffstat (limited to 'cloudinit/config/cc_users_groups.py')
-rw-r--r--cloudinit/config/cc_users_groups.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/cloudinit/config/cc_users_groups.py b/cloudinit/config/cc_users_groups.py
index 273c5068..a6ce49ac 100644
--- a/cloudinit/config/cc_users_groups.py
+++ b/cloudinit/config/cc_users_groups.py
@@ -24,7 +24,6 @@ frequency = PER_INSTANCE
def handle(name, cfg, cloud, log, _args):
-
distro = cloud.distro
((users, default_user), groups) = distro.normalize_users_groups(cfg)
for (name, members) in groups.items():
@@ -34,7 +33,6 @@ def handle(name, cfg, cloud, log, _args):
user = default_user['name']
config = default_user['config']
def_base_config = {
- 'name': user,
'plain_text_passwd': user,
'home': "/home/%s" % user,
'shell': "/bin/bash",
@@ -43,7 +41,8 @@ def handle(name, cfg, cloud, log, _args):
'sudo': "ALL=(ALL) NOPASSWD:ALL",
}
u_config = util.mergemanydict([def_base_config, config])
- distro.create_user(**u_config)
+ distro.create_user(user, **u_config)
+ log.info("Added default '%s' user with passwordless sudo", user)
for (user, config) in users.items():
distro.create_user(user, **config)