diff options
author | Scott Moser <smoser@ubuntu.com> | 2012-08-22 21:20:34 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-08-22 21:20:34 -0400 |
commit | 2de30c15e706a9610c19979886f13addecf7ea1b (patch) | |
tree | fc0dc5441f5a280ca9b73f16e7809bde62acf00c /cloudinit/config | |
parent | d59ab509f6482b8b3af4fd9f2728ad1209d5b2e2 (diff) | |
download | vyos-cloud-init-2de30c15e706a9610c19979886f13addecf7ea1b.tar.gz vyos-cloud-init-2de30c15e706a9610c19979886f13addecf7ea1b.zip |
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
Diffstat (limited to 'cloudinit/config')
-rw-r--r-- | cloudinit/config/cc_users_groups.py | 14 |
1 files changed, 2 insertions, 12 deletions
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 <http://www.gnu.org/licenses/>. -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 |