summaryrefslogtreecommitdiff
path: root/cloudinit/distros
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/distros')
-rw-r--r--cloudinit/distros/__init__.py12
-rw-r--r--cloudinit/distros/fedora.py3
-rw-r--r--cloudinit/distros/ubuntu.py5
3 files changed, 6 insertions, 14 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
index 3e9d934d..cdb72b5a 100644
--- a/cloudinit/distros/__init__.py
+++ b/cloudinit/distros/__init__.py
@@ -44,10 +44,7 @@ LOG = logging.getLogger(__name__)
class Distro(object):
-
__metaclass__ = abc.ABCMeta
- default_user = None
- default_user_groups = None
def __init__(self, name, cfg, paths):
self._paths = paths
@@ -61,7 +58,6 @@ class Distro(object):
user = self.get_default_user()
groups = self.get_default_user_groups()
-
if not user:
raise NotImplementedError("No Default user")
@@ -71,12 +67,12 @@ class Distro(object):
'home': "/home/%s" % user,
'shell': "/bin/bash",
'lock_passwd': True,
- 'gecos': "%s%s" % (user[0:1].upper(), user[1:]),
+ 'gecos': user.title(),
'sudo': "ALL=(ALL) NOPASSWD:ALL",
}
if groups:
- user_dict['groups'] = groups
+ user_dict['groups'] = ",".join(groups)
self.create_user(**user_dict)
@@ -212,10 +208,10 @@ class Distro(object):
return False
def get_default_user(self):
- return self.default_user
+ return self.get_option('default_user')
def get_default_user_groups(self):
- return self.default_user_groups
+ return self.get_option('default_user_groups')
def create_user(self, name, **kwargs):
"""
diff --git a/cloudinit/distros/fedora.py b/cloudinit/distros/fedora.py
index 9f76a116..c777845d 100644
--- a/cloudinit/distros/fedora.py
+++ b/cloudinit/distros/fedora.py
@@ -28,5 +28,4 @@ LOG = logging.getLogger(__name__)
class Distro(rhel.Distro):
- distro_name = 'fedora'
- default_user = 'ec2-user'
+ pass
diff --git a/cloudinit/distros/ubuntu.py b/cloudinit/distros/ubuntu.py
index 22f8c2c5..428db6ad 100644
--- a/cloudinit/distros/ubuntu.py
+++ b/cloudinit/distros/ubuntu.py
@@ -28,8 +28,5 @@ LOG = logging.getLogger(__name__)
class Distro(debian.Distro):
+ pass
- distro_name = 'ubuntu'
- default_user = 'ubuntu'
- default_user_groups = ("adm,audio,cdrom,dialout,floppy,video,"
- "plugdev,dip,netdev,sudo")