summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Client/Tools/POSIXUsers.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-05-07 14:28:22 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-05-07 14:43:37 -0400
commit4cb722d650a7cc5d0f58141d309896b901d19784 (patch)
tree799abd847868ef78059a513e914c5b84781c1831 /src/lib/Bcfg2/Client/Tools/POSIXUsers.py
parent9d6387d66c863c8525a4521258ccda136c3d6817 (diff)
downloadbcfg2-4cb722d650a7cc5d0f58141d309896b901d19784.tar.gz
bcfg2-4cb722d650a7cc5d0f58141d309896b901d19784.tar.bz2
bcfg2-4cb722d650a7cc5d0f58141d309896b901d19784.zip
POSIXUsers: allow better <MemberOf group="foo"/> syntax
Diffstat (limited to 'src/lib/Bcfg2/Client/Tools/POSIXUsers.py')
-rw-r--r--src/lib/Bcfg2/Client/Tools/POSIXUsers.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Client/Tools/POSIXUsers.py b/src/lib/Bcfg2/Client/Tools/POSIXUsers.py
index 0250a1a42..8226392f9 100644
--- a/src/lib/Bcfg2/Client/Tools/POSIXUsers.py
+++ b/src/lib/Bcfg2/Client/Tools/POSIXUsers.py
@@ -154,7 +154,8 @@ class POSIXUsers(Bcfg2.Client.Tools.Tool):
if entry.get("current_exists", "true") == "true":
# verify supplemental groups
actual = [g[0] for g in self.user_supplementary_groups(entry)]
- expected = [e.text.strip() for e in entry.findall("MemberOf")]
+ expected = [e.get("group", e.text).strip()
+ for e in entry.findall("MemberOf")]
if set(expected) != set(actual):
entry.set('qtext',
"\n".join([entry.get('qtext', '')] +
@@ -252,7 +253,8 @@ class POSIXUsers(Bcfg2.Client.Tools.Tool):
if entry.get('uid'):
cmd.extend(['-u', entry.get('uid')])
cmd.extend(['-g', entry.get('group')])
- extras = [e.text.strip() for e in entry.findall("MemberOf")]
+ extras = [e.get("group", e.text).strip()
+ for e in entry.findall("MemberOf")]
if extras:
cmd.extend(['-G', ",".join(extras)])
cmd.extend(['-d', entry.get('home')])