def syncRippleStartDone(distDir, wasRoot): applicationModels = getApplications(distDir, "*.xml.done") applicationModels.extend(getApplications(distDir, "*.xml.confirmed")) calculateAffectedNodes("update", wasRoot, applicationModels) PreValidateNodesAndServers(Globals.uniqueNodesContainedServers) syncRippleStart("update", applicationModels) configSave()
def confirm(action, distDir, wasRoot): log(VERBOSE_, "confirm: " + action + " " + distDir) log(VERBOSE_, "confirm: " + wasRoot + " ...") ############### FIND APPLICATIONS #################### applicationModels = getApplications(distDir, "*.xml.done") applicationModels.extend(getApplications(distDir, "*.xml.confirmed")) for applicationModel in applicationModels: log(INFO_, "confirm: Deployment applicationModel=" + `applicationModel.name`) ################## PRE-VALIDATE APPLICATIONS (exists) #################### PreValidateApplicationsExist(applicationModels) ############### CALCULATE AFFECTED NODES #################### calculateAffectedNodes(action, wasRoot, applicationModels) ################## PRE-VALIDATE NODES and SERVERS #################### PreValidateNodesAndServers(Globals.uniqueNodesContainedServers) ################## TEST #################### testApplication(applicationModels) nodeSyncStatus = {} for nodeContainedServers in Globals.uniqueNodesContainedServers: node = nodeContainedServers[0] if not node in nodeSyncStatus.keys(): nodeSync = WebSphere.AdminControl.completeObjectName("type=NodeSync,node=%s,*" % node) nodeSyncStatus[node] = WebSphere.AdminControl.invoke(nodeSync, "isNodeSynchronized") print "NODE SYNC STATUS: %s" % nodeSyncStatus highlight(MAJOR_, "confirm: DONE.")
def uninstall(action, distDir, wasRoot): log(VERBOSE_, "uninstall: " + action + " " + distDir) log(VERBOSE_, "uninstall: " + wasRoot + " ...") ############### FIND APPLICATIONS #################### applicationModels = getApplications(distDir) for applicationModel in applicationModels: log(INFO_, "uninstall: Deployment applicationModel=" + `applicationModel.name`) ################## PRE-VALIDATE APPLICATIONS (exists) #################### PreValidateApplicationsExist(applicationModels) ############### CALCULATE AFFECTED NODES #################### calculateAffectedNodes(action, wasRoot, applicationModels) ################## PRE-VALIDATE NODES and SERVERS #################### PreValidateNodesAndServers(Globals.uniqueNodesContainedServers) ValidateSynched(Globals.uniqueNodesContainedServers) listApplications() #endFor for item in Globals.appsNodesServers: applicationModel = item[0] appExists = checkIfAppExists(applicationModel) if appExists: StopApplicationOnNodesAndServers(applicationModel, item[1]) uninstallEAR(applicationModel) #endIf #endFor listApplications() configSave() for applicationModel in applicationModels: log(INFO_, "DONE: uninstall application=" + `applicationModel.name`)
def confirm(action, distDir, wasRoot): log(VERBOSE_, "confirm: " + action + " " + distDir) log(VERBOSE_, "confirm: " + wasRoot + " ...") ############### FIND APPLICATIONS #################### applicationModels = getApplications(distDir, "*.xml.done") applicationModels.extend(getApplications(distDir, "*.xml.confirmed")) for applicationModel in applicationModels: log( INFO_, "confirm: Deployment applicationModel=" + ` applicationModel.name `) ################## PRE-VALIDATE APPLICATIONS (exists) #################### PreValidateApplicationsExist(applicationModels) ############### CALCULATE AFFECTED NODES #################### calculateAffectedNodes(action, wasRoot, applicationModels) ################## PRE-VALIDATE NODES and SERVERS #################### PreValidateNodesAndServers(Globals.uniqueNodesContainedServers) ################## TEST #################### testApplication(applicationModels) nodeSyncStatus = {} for nodeContainedServers in Globals.uniqueNodesContainedServers: node = nodeContainedServers[0] if not node in nodeSyncStatus.keys(): nodeSync = WebSphere.AdminControl.completeObjectName( "type=NodeSync,node=%s,*" % node) nodeSyncStatus[node] = WebSphere.AdminControl.invoke( nodeSync, "isNodeSynchronized") print "NODE SYNC STATUS: %s" % nodeSyncStatus highlight(MAJOR_, "confirm: DONE.")
def uninstall(action, distDir, wasRoot): log(VERBOSE_, "uninstall: " + action + " " + distDir) log(VERBOSE_, "uninstall: " + wasRoot + " ...") ############### FIND APPLICATIONS #################### applicationModels = getApplications(distDir) for applicationModel in applicationModels: log( INFO_, "uninstall: Deployment applicationModel=" + ` applicationModel.name `) ################## PRE-VALIDATE APPLICATIONS (exists) #################### PreValidateApplicationsExist(applicationModels) ############### CALCULATE AFFECTED NODES #################### calculateAffectedNodes(action, wasRoot, applicationModels) ################## PRE-VALIDATE NODES and SERVERS #################### PreValidateNodesAndServers(Globals.uniqueNodesContainedServers) ValidateSynched(Globals.uniqueNodesContainedServers) listApplications() #endFor for item in Globals.appsNodesServers: applicationModel = item[0] appExists = checkIfAppExists(applicationModel) if appExists: StopApplicationOnNodesAndServers(applicationModel, item[1]) uninstallEAR(applicationModel) #endIf #endFor listApplications() configSave() for applicationModel in applicationModels: log(INFO_, "DONE: uninstall application=" + ` applicationModel.name `)
def installOrUpdate(action, distDir, wasRoot): log(VERBOSE_, "installOrUpdate: " + action + " " + distDir) log(VERBOSE_, "installOrUpdate: " + wasRoot + " ...") applicationModels = getApplications(distDir) ################## PRE-VALIDATE Application TARGETS+SETTINGS files #################### if action == "install": PreValidateApplicationsAbsent(applicationModels) else: PreValidateApplicationsExist(applicationModels) #endElse ############### CALCULATE AFFECTED NODES #################### calculateAffectedNodes(action, wasRoot, applicationModels) ################## PRE-VALIDATE NODES and SERVERS #################### PreValidateNodesAndServers(Globals.uniqueNodesContainedServers) ############### PREPARE AFFECTED NODES #################### #if ((action == "update")): # Globals.nodesAutosyncs = saveAndDisableAutosync(action, Globals.uniqueNodesContainedServers) # log(INFO_, "installOrUpdate: RESULT: nodesAutosyncs="+`Globals.nodesAutosyncs`) #endIf ############### INSTALL APPLICATION AND CONFIGURE #################### applicationModels = installAndConfigureApps(action, distDir, wasRoot, applicationModels) calculateAffectedNodes(action, wasRoot, applicationModels) for item in Globals.appsNodesServers: for nodeServer in item[1]: nodeName = nodeServer.nodeName serverName = nodeServer.serverName if len(nodeServer.jvmAttributes) > 0: jvmAttributes = [] for jvmAttribute in nodeServer.jvmAttributes: log(INFO_, "jvmAttribute " + nodeName + ":" + serverName + "(" + jvmAttribute.name + ")=" + jvmAttribute.value) jvmAttributes.append([jvmAttribute.name, jvmAttribute.value]) jvmID = getJvmID(nodeName, serverName) modifyJvmAttrs(jvmID, jvmAttributes) configSave() ################## SYNC NODES (DISTRIBUTE APPS) #################### log(MAJOR_, "installOrUpdate: syncRippleStart of affected nodes ...") syncRippleStart(action, applicationModels) log(MAJOR_, "installOrUpdate: syncRippleStart of affected nodes DONE.") ################## START INSTALLED APPLICATIONS #################### if action == "install": for item in Globals.appsNodesServers: applicationModel = item[0] StartApplicationOnNodesAndServers(applicationModel, item[1]) #endFor #endIf ############### RESTORE AFFECTED NODES #################### #if ((action == "update")): # log(DEBUG_, "installOrUpdate: nodesAutosyncs="+`Globals.nodesAutosyncs`) # restoreAutosync(action, Globals.nodesAutosyncs) #endIf configSave() ################## TEST: Skipped for now, only on confirm ## testApplication(applicationModels) highlight(MAJOR_, "installOrUpdate: DONE.")
if lines is None or len(lines) == 0: print "-> FAILED CONNECT FOR: %s" % test.url else: found = 0 for line in lines: sgmlData = " ".join(extractSgmlData(line)) if sgmlData.find("Version") >= 0 or sgmlData.find("version") >= 0: print "-> SUCCESS, New Version:%s, Current %s" % (applicationModel.version, sgmlData) found = 1 if not found: print "-> FAILED, no version found in: %s" % test.url if cookiePath: print "-> CookiePath=%s" % cookiePath distDir = "" files = "/*.xml" if len(sys.argv) > 0: param1 = sys.argv[0] param1 = param1[len(param1) - 3:].lower() if param1 == ".py" or param1 == ".jy": if len(sys.argv) > 1: distDir = sys.argv[1] if len(sys.argv) > 2: files = sys.argv[2] else: distDir = sys.argv[0] if len(sys.argv) > 1: files = sys.argv[1] applicationModels = getApplications(distDir, files) testUrls(applicationModels)
found = 0 for line in lines: sgmlData = " ".join(extractSgmlData(line)) if sgmlData.find("Version") >= 0 or sgmlData.find( "version") >= 0: print "-> SUCCESS, New Version:%s, Current %s" % ( applicationModel.version, sgmlData) found = 1 if not found: print "-> FAILED, no version found in: %s" % test.url if cookiePath: print "-> CookiePath=%s" % cookiePath distDir = "" files = "/*.xml" if len(sys.argv) > 0: param1 = sys.argv[0] param1 = param1[len(param1) - 3:].lower() if param1 == ".py" or param1 == ".jy": if len(sys.argv) > 1: distDir = sys.argv[1] if len(sys.argv) > 2: files = sys.argv[2] else: distDir = sys.argv[0] if len(sys.argv) > 1: files = sys.argv[1] applicationModels = getApplications(distDir, files) testUrls(applicationModels)
def installOrUpdate(action, distDir, wasRoot): log(VERBOSE_, "installOrUpdate: " + action + " " + distDir) log(VERBOSE_, "installOrUpdate: " + wasRoot + " ...") applicationModels = getApplications(distDir) ################## PRE-VALIDATE Application TARGETS+SETTINGS files #################### if action == "install": PreValidateApplicationsAbsent(applicationModels) else: PreValidateApplicationsExist(applicationModels) #endElse ############### CALCULATE AFFECTED NODES #################### calculateAffectedNodes(action, wasRoot, applicationModels) ################## PRE-VALIDATE NODES and SERVERS #################### PreValidateNodesAndServers(Globals.uniqueNodesContainedServers) ############### PREPARE AFFECTED NODES #################### #if ((action == "update")): # Globals.nodesAutosyncs = saveAndDisableAutosync(action, Globals.uniqueNodesContainedServers) # log(INFO_, "installOrUpdate: RESULT: nodesAutosyncs="+`Globals.nodesAutosyncs`) #endIf ############### INSTALL APPLICATION AND CONFIGURE #################### applicationModels = installAndConfigureApps(action, distDir, wasRoot, applicationModels) calculateAffectedNodes(action, wasRoot, applicationModels) for item in Globals.appsNodesServers: for nodeServer in item[1]: nodeName = nodeServer.nodeName serverName = nodeServer.serverName if len(nodeServer.jvmAttributes) > 0: jvmAttributes = [] for jvmAttribute in nodeServer.jvmAttributes: log( INFO_, "jvmAttribute " + nodeName + ":" + serverName + "(" + jvmAttribute.name + ")=" + jvmAttribute.value) jvmAttributes.append( [jvmAttribute.name, jvmAttribute.value]) jvmID = getJvmID(nodeName, serverName) modifyJvmAttrs(jvmID, jvmAttributes) configSave() ################## SYNC NODES (DISTRIBUTE APPS) #################### log(MAJOR_, "installOrUpdate: syncRippleStart of affected nodes ...") syncRippleStart(action, applicationModels) log(MAJOR_, "installOrUpdate: syncRippleStart of affected nodes DONE.") ################## START INSTALLED APPLICATIONS #################### if action == "install": for item in Globals.appsNodesServers: applicationModel = item[0] StartApplicationOnNodesAndServers(applicationModel, item[1]) #endFor #endIf ############### RESTORE AFFECTED NODES #################### #if ((action == "update")): # log(DEBUG_, "installOrUpdate: nodesAutosyncs="+`Globals.nodesAutosyncs`) # restoreAutosync(action, Globals.nodesAutosyncs) #endIf configSave() ################## TEST: Skipped for now, only on confirm ## testApplication(applicationModels) highlight(MAJOR_, "installOrUpdate: DONE.")