diff options
Diffstat (limited to 'java/config/IcePackAdmin.py')
-rw-r--r-- | java/config/IcePackAdmin.py | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/java/config/IcePackAdmin.py b/java/config/IcePackAdmin.py index 2f7667cfb62..3b8d5d9764b 100644 --- a/java/config/IcePackAdmin.py +++ b/java/config/IcePackAdmin.py @@ -27,7 +27,7 @@ def startIcePackRegistry(toplevel, port, testdir): icePack = os.path.join(toplevel, "bin", "icepackregistry") - dataDir = os.path.join(testdir, "db/registry") + dataDir = os.path.join(testdir, "db", "registry") if not os.path.exists(dataDir): os.mkdir(dataDir) @@ -57,16 +57,19 @@ def startIcePackNode(toplevel, testdir): icePack = os.path.join(toplevel, "bin", "icepacknode") - dataDir = os.path.join(testdir, "db/node") + dataDir = os.path.join(testdir, "db", "node") if not os.path.exists(dataDir): os.mkdir(dataDir) + overrideOptions = '"' + options.replace("--", "") + '"' + print "starting icepack node...", command = icePack + options + ' --nowarn ' + \ r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \ r' --IcePack.Node.Endpoints=default' + \ r' --IcePack.Node.Data=' + dataDir + \ r' --IcePack.Node.Name=localnode' + \ + r' --IcePack.Node.PropertiesOverride=' + overrideOptions + \ r' --Ice.ProgramName=icepacknode' + \ r' --IcePack.Node.Trace.Activator=0' + \ r' --IcePack.Node.Trace.Adapter=0' + \ @@ -217,3 +220,32 @@ def listAdapters(toplevel): icePackAdminPipe = os.popen(command) return icePackAdminPipe +def cleanDbDir(path): + + try: + cleanServerDir(os.path.join(path, "node", "servers")) + except: + pass + + try: + TestUtil.cleanDbDir(os.path.join(path, "node", "db")) + except: + pass + + try: + TestUtil.cleanDbDir(os.path.join(path, "registry")) + except: + pass + +def cleanServerDir(path): + + files = os.listdir(path) + + for filename in files: + fullpath = os.path.join(path, filename); + if os.path.isdir(fullpath): + cleanServerDir(fullpath) + os.rmdir(fullpath) + else: + os.remove(fullpath) + |