Hi all, first post so hopefully I'm in the correct place.
I'm new to python/jython and am currently trying to write a hot-deploy script, in short its working, however I am now making it for mulitple applications. I'm really struggling to get the path to a JAR archive into a list. I have a property file that contains the following:
In python I am creating a list and trying to append it with the .path part of the property file. I know these values are working because I can bind them into a string and print it to the screen. I can also hardcode the path into a string and that imports into the list as well. However with the following it falls over with a " TypeError: __add__ nor __radd__ defined for these operands" error.
def unDeployApps(): unApps=splitMap(props,'undeployapplication.') for unApp in unApps.keys(): properties=unApps[unApp] unDepSuccess= unDepSuccess.append("hello") unDepSuccess.append("Test") unDepSuccess.append("Bye") # Test to prove list is ok print unDepSuccess strTest=properties["path"] # This also prints the correct path print "Printing strTest " + strTest print "Adding strTest to Array " + `unDepSuccess` # This is where is falls over unDepSuccess.append(strTest) print "Printing unDepSuccess " + unDepSuccess
[java] Printing strTest /opt/app/stage/dsb-apps/02-console.ear
[java] Adding strTest to Array
[java] File "/opt/app/stage/redeployment/redeploy.py", line 136, in ?
[java] File "/opt/app/stage/redeployment/redeploy.py", line 69, in unDeployApps
[java] TypeError: __add__ nor __radd__ defined for these operands
I'm probably making a very basic error somewhere but if anyone can point me in the right direction it'd be appreciated.
Many thanks, hopefully I can feed back into this forum when I actually know what I'm doing :)