Also allow the user list to come in as a comma
separated list so that its types match more of what the group list can be.
This commit is contained in:
parent
a4206d9a7c
commit
78f370f116
|
@ -338,6 +338,8 @@ class Distro(object):
|
|||
raise TypeError(("Unmappable user value type %s"
|
||||
" for key %s") % (util.obj_name(v), k))
|
||||
u_cfg = ad_ucfg
|
||||
elif isinstance(u_cfg, (str, basestring)):
|
||||
u_cfg = u_cfg.strip().split(",")
|
||||
|
||||
users = {}
|
||||
for user_config in u_cfg:
|
||||
|
|
|
@ -112,6 +112,17 @@ class TestUGNormalize(MockerTestCase):
|
|||
((users, def_user), groups) = distro.normalize_users_groups(ug_cfg)
|
||||
self.assertEquals({}, def_user)
|
||||
|
||||
def test_users_simple_csv(self):
|
||||
distro = self._make_distro('ubuntu')
|
||||
ug_cfg = {
|
||||
'users': 'joe,bob',
|
||||
}
|
||||
((users, def_user), groups) = distro.normalize_users_groups(ug_cfg)
|
||||
self.assertIn('joe', users)
|
||||
self.assertIn('bob', users)
|
||||
self.assertEquals({}, users['joe'])
|
||||
self.assertEquals({}, users['bob'])
|
||||
|
||||
def test_users_simple(self):
|
||||
distro = self._make_distro('ubuntu')
|
||||
ug_cfg = {
|
||||
|
|
Loading…
Reference in New Issue