def getDeployedLibraries():
serverConfig()
path = 'somePath'
deployments = cmo.getLibraries()
print(divider)
print("Library Deployments:" )
print(divider)
if deployments:
deployedLibs = []
stagedLibs = []
archiveLibs = []
for dep in deployments:
full_name = dep.getName()
path = dep.getAbsoluteSourcePath()
deployedLibs.append(path+full_name)
for (dirpath, dirnames, files) in os.walk(path):
for name in dirnames:
if name != "shared-lib":
dirnames.remove(name)
for file in files:
stagedLibs.append(file)
for sLib in stagedLibs:
if sLib not in deployedLibs:
archiveLibs.append(sLib)
f = open("filesToArchive.txt","w")
f.write("\n".join(archiveLibs))
f.close()
else:
deploymentsList.append("No deployments of this type installed.")
domainConfig()
return deploymentsList
此脚本的确连接到WLST,所以我认为也许我遇到了冲突,但没有发现任何迹象表明此类冲突。我需要在Linux服务器上递归地搜索目录/子目录以查找特定名称的目录,并在这些特定目录中检索文件。我尝试了2种方法,一种...