"""
-import sys, os, getopt, string, exceptions
+import sys, os, getopt, string, exceptions, random
import xml.dom.minidom
from xml.dom.ext import PrettyPrint
return ret
def new_uuid(name):
- return "%s_UUID" % (name)
+ ret_uuid = '%05x_%.19s_%05x%05x' % (int(random.random() * 1048576),
+ name,
+ int(random.random() * 1048576),
+ int(random.random() * 1048576))
+ return ret_uuid[:36]
ldlm_name = 'ldlm'
ldlm_uuid = 'ldlm_UUID'
gen = GenConfig(doc)
+ # the PRNG is normally seeded with time(), which is not so good for starting # time-synchronized clusters
+ input = open('/dev/urandom', 'r')
+ if not input:
+ print 'Unable to open /dev/urandom!'
+ sys.exit(1)
+ seed = input.read(32)
+ input.close()
+ random.seed(seed)
+
if options.batch:
fp = open(options.batch)
batchCommands = fp.readlines()