Using Jython:
deploymentObj1 = AdminConfig.showAttribute(deployments, 'deployedObject')
targetMap1 = AdminConfig.showAttribute(deploymentObj1, 'targetMappings')
targetMap1 = targetMap1[1:len(targetMap1)-1].split(" ")
print targetMap1
Avoid trouble: When you attempt to obtain the
target mappings in the application through scripting and then assigning
those values to the
targetMappings variable, be
aware when the application has a space in the name or blank. In these
cases, you must compensate for the occurrence of a blank or space
character as the Jython example demonstrates. Errors can occur if
you do not make this adjustment. Consider the following scenarios:
- If only one single DeploymentTargetMapping value
exists within the deployment.xml file, you can
either split the targetMappings value with a space
or a line.separator entry. The line.separator entry
syntax works when the application name contains a space, such as "IVT
Application". For example:
targetMap1 = targetMap1[1:len(targetMap1)-1].split(" ")
ortargetMap1 =
targetMap1[1:len(targetMap1)-1].split(java.lang.System.getProperty("line.separator"))
- If multiple DeploymentTargetMapping values
exist within the deployment.xml file, split the targetMappings values
with a space. However, you must also use "\"" and " ", as appropriate,
when the application name or deployment target string contains a space
character. For example:
targetMap1 = targetMap1[1:len(targetMap1)-1].split(" ")
gotcha