summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/accounts2xml.py9
1 files changed, 7 insertions, 2 deletions
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)