summaryrefslogtreecommitdiff
path: root/cloudinit/distros/__init__.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-11-10 22:32:49 -0500
committerScott Moser <smoser@ubuntu.com>2012-11-10 22:32:49 -0500
commit3248ac9bbb2008e88a3bd9c030ba0fcbc14b7fce (patch)
tree7f9855096e0e313df3fb5d5684c14c7099bef6d7 /cloudinit/distros/__init__.py
parent6a3bd563282a51695bf1384d057d0495fd59929f (diff)
downloadvyos-cloud-init-3248ac9bbb2008e88a3bd9c030ba0fcbc14b7fce.tar.gz
vyos-cloud-init-3248ac9bbb2008e88a3bd9c030ba0fcbc14b7fce.zip
whitespace / indentation cleanups
These changes were pulled out of the previous merge (cc_yum_add_repo) as they were unrelated there. Re-applying them here.
Diffstat (limited to 'cloudinit/distros/__init__.py')
-rw-r--r--cloudinit/distros/__init__.py38
1 files changed, 18 insertions, 20 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
index d2cb0a8b..8a98e334 100644
--- a/cloudinit/distros/__init__.py
+++ b/cloudinit/distros/__init__.py
@@ -187,23 +187,23 @@ class Distro(object):
# inputs. If something goes wrong, we can end up with a system
# that nobody can login to.
adduser_opts = {
- "gecos": '--comment',
- "homedir": '--home',
- "primary_group": '--gid',
- "groups": '--groups',
- "passwd": '--password',
- "shell": '--shell',
- "expiredate": '--expiredate',
- "inactive": '--inactive',
- "selinux_user": '--selinux-user',
- }
+ "gecos": '--comment',
+ "homedir": '--home',
+ "primary_group": '--gid',
+ "groups": '--groups',
+ "passwd": '--password',
+ "shell": '--shell',
+ "expiredate": '--expiredate',
+ "inactive": '--inactive',
+ "selinux_user": '--selinux-user',
+ }
adduser_opts_flags = {
- "no_user_group": '--no-user-group',
- "system": '--system',
- "no_log_init": '--no-log-init',
- "no_create_home": "-M",
- }
+ "no_user_group": '--no-user-group',
+ "system": '--system',
+ "no_log_init": '--no-log-init',
+ "no_create_home": "-M",
+ }
# Now check the value and create the command
for option in kwargs:
@@ -320,11 +320,9 @@ class Distro(object):
raise e
util.ensure_dir(path, 0750)
- def write_sudo_rules(self,
- user,
- rules,
- sudo_file="/etc/sudoers.d/90-cloud-init-users",
- ):
+ def write_sudo_rules(self, user, rules, sudo_file=None):
+ if not sudo_file:
+ sudo_file = "/etc/sudoers.d/90-cloud-init-users"
content_header = "# user rules for %s" % user
content = "%s\n%s %s\n\n" % (content_header, user, rules)