From d05dd3963eda608df0b14042e8548d42c860835e Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Wed, 22 Aug 2012 22:35:18 -0400 Subject: fix duplicate flags being passed to useradd Fix bug here: adduser_cmd = ['useradd', name] x_adduser_cmd = adduser_cmd is different than x_adduser_cmd = ['useradd', name] The problem was they referenced the same list, and we were doubly appending. --- cloudinit/distros/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cloudinit') diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py index 478e3993..8da9a0b5 100644 --- a/cloudinit/distros/__init__.py +++ b/cloudinit/distros/__init__.py @@ -218,7 +218,7 @@ class Distro(object): LOG.debug("Creating name %s" % name) adduser_cmd = ['useradd', name] - x_adduser_cmd = adduser_cmd + x_adduser_cmd = ['useradd', name] # Since we are creating users, we want to carefully validate the # inputs. If something goes wrong, we can end up with a system @@ -254,7 +254,7 @@ class Distro(object): else: x_adduser_cmd.extend([adduser_opts[option], 'REDACTED']) - if option in adduser_opts_flags and value: + elif option in adduser_opts_flags and value: adduser_cmd.append(adduser_opts_flags[option]) x_adduser_cmd.append(adduser_opts_flags[option]) -- cgit v1.2.3