From 2de30c15e706a9610c19979886f13addecf7ea1b Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Wed, 22 Aug 2012 21:20:34 -0400 Subject: fix issues from 'make pylint' In an effort to pylint errors about NonImlementedError and add_default_user, I moved this method to distro and genericized it. Now, assuming a sane 'create_user' for the distro, this should work. Also: * removed the unused set_configured_user method --- cloudinit/config/cc_users_groups.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'cloudinit/config') diff --git a/cloudinit/config/cc_users_groups.py b/cloudinit/config/cc_users_groups.py index cbb351dc..1e241623 100644 --- a/cloudinit/config/cc_users_groups.py +++ b/cloudinit/config/cc_users_groups.py @@ -16,22 +16,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import grp -import os -import pwd -import traceback - from cloudinit.settings import PER_INSTANCE -from cloudinit import ssh_util -from cloudinit import templater -from cloudinit import util frequency = PER_INSTANCE def handle(name, cfg, cloud, log, _args): - groups_cfg = None - users_cfg = None user_zero = None if 'groups' in cfg: @@ -43,7 +33,7 @@ def handle(name, cfg, cloud, log, _args): elif isinstance(values, str): cloud.distro.create_group(name, values.split(',')) else: - cloud.distro.create_group(item, []) + cloud.distro.create_group(group, []) if 'users' in cfg: user_zero = None @@ -63,7 +53,7 @@ def handle(name, cfg, cloud, log, _args): if user_zero == name: user_zero = cloud.distro.get_default_user() - except NotImplementedError as e: + except NotImplementedError: if user_zero == name: user_zero = None -- cgit v1.2.3