def createTestDomain():
domainName = getTestDomainName()
print domainName
domainPath = os.path.join(getSdrPath(), "dom", "domain")
templatePath = os.path.join(getSdrPath(), "templates", "domain")
# Create a test domain
if os.path.isdir(domainPath):
shutil.rmtree(domainPath)
# Copy the template over
shutil.copytree(templatePath, domainPath)
# Open the DMD file and replace the name, using a very naive method
dmd = open(os.path.join(domainPath, "DomainManager.dmd.xml"), "r")
lines = dmd.read()
dmd.close()
lines = lines.replace("${DOMAINNAME}", domainName)
dmd = open(os.path.join(domainPath, "DomainManager.dmd.xml"), "w+")
dmd.write(lines)
dmd.close()
setupDeviceAndDomainMgrPackage()
评论列表
文章目录