+# Generate the voipPassword list
+def GenVoipPassword(accounts, File):
+ F = None
+ try:
+ OldMask = os.umask(0077)
+ F = open(File, "w", 0600)
+ os.umask(OldMask)
+
+ root = Element('include')
+
+ for a in accounts:
+ if not 'voipPassword' in a: continue
+ if not a.pw_active(): continue
+
+ Pass = str(a['voipPassword'])
+ user = Element('user')
+ user.attrib['id'] = "%s" % (a['uid'])
+ root.append(user)
+ params = Element('params')
+ user.append(params)
+ param = Element('param')
+ params.append(param)
+ param.attrib['name'] = "a1-hash"
+ param.attrib['value'] = "%s" % (Pass)
+ variables = Element('variables')
+ user.append(variables)
+ variable = Element('variable')
+ variable.attrib['name'] = "toll_allow"
+ variable.attrib['value'] = "domestic,international,local"
+ variables.append(variable)
+
+ F.write("%s" % (prettify(root)))
+
+
+ except:
+ Die(File, None, F)
+ raise
+
+def GenSSHtarballs(global_dir, userlist, ssh_userkeys, grouprevmap, target, current_host):