From c685761bdcea79f5e8b115f2ba48935176518925 Mon Sep 17 00:00:00 2001 From: DongInn Kim Date: Mon, 14 May 2012 11:01:13 -0400 Subject: Store group="name" rather than gid="GID" at the attribute of UnixUser. This fixes the wrong behavior of creating the usergroup data. Thanks emias for helping me out this problem. --- tools/accounts2xml.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/accounts2xml.py b/tools/accounts2xml.py index 590e0041d..183a70174 100755 --- a/tools/accounts2xml.py +++ b/tools/accounts2xml.py @@ -60,6 +60,7 @@ import sys import csv import os import re +import grp from xml.dom.minidom import Document def main(args): @@ -112,8 +113,12 @@ def main(args): def create_col_nodes(cols, item, doc, row): for col in cols: - att = doc.createAttribute(str.replace(col, " ", "_").lower()) - att.nodeValue = row.pop(0) + if col == "gid": + att = doc.createAttribute("group") + att.nodeValue = grp.getgrgid(int(row.pop(0)))[0] + else: + att = doc.createAttribute(str.replace(col, " ", "_").lower()) + att.nodeValue = row.pop(0) if col != "pass": item.setAttributeNode(att) -- cgit v1.2.3-1-g7c22