summaryrefslogtreecommitdiff
path: root/tests/unittests
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2016-09-30 22:30:48 -0700
committerScott Moser <smoser@ubuntu.com>2016-10-19 17:57:54 -0400
commitf0747c4b4cf073273e11d383f0354257be7276ed (patch)
tree3f7a0426c12740395dbc5e668d546ca1a920e036 /tests/unittests
parent7ae201166402fbf2e6c1632028be956a954835ef (diff)
downloadvyos-cloud-init-f0747c4b4cf073273e11d383f0354257be7276ed.tar.gz
vyos-cloud-init-f0747c4b4cf073273e11d383f0354257be7276ed.zip
Move user/group functions to new ug_util file
The amount of code to do user and group normalization and extraction deserves its own file so move the code that does this to a new file and update references to the old location. This removes some of the funkyness done in config modules to avoid namespace and attribute clashes as well.
Diffstat (limited to 'tests/unittests')
-rwxr-xr-x[-rw-r--r--]tests/unittests/test_distros/test_user_data_normalize.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/unittests/test_distros/test_user_data_normalize.py b/tests/unittests/test_distros/test_user_data_normalize.py
index a887a930..b24888fc 100644..100755
--- a/tests/unittests/test_distros/test_user_data_normalize.py
+++ b/tests/unittests/test_distros/test_user_data_normalize.py
@@ -1,4 +1,5 @@
from cloudinit import distros
+from cloudinit.distros import ug_util
from cloudinit import helpers
from cloudinit import settings
@@ -29,7 +30,7 @@ class TestUGNormalize(TestCase):
return distro
def _norm(self, cfg, distro):
- return distros.normalize_users_groups(cfg, distro)
+ return ug_util.normalize_users_groups(cfg, distro)
def test_group_dict(self):
distro = self._make_distro('ubuntu')
@@ -236,7 +237,7 @@ class TestUGNormalize(TestCase):
}
(users, _groups) = self._norm(ug_cfg, distro)
self.assertIn('bob', users)
- (name, config) = distros.extract_default(users)
+ (name, config) = ug_util.extract_default(users)
self.assertEqual(name, 'bob')
expected_config = {}
def_config = None