def deleteJMSModule(jmsModule): myBean = getMBean('/SystemResources/' + jmsModule) if myBean is not None: edit() startEdit() try: cmo.destroyJMSSystemResource(getMBean('/SystemResources/' + jmsModule)) print "deleted JMSModule " + jmsModule validate() save() activate() except: print('unable to delete preexisting JMSModule ' + jmsModule) dumpStack() undo('true', 'y') cancelEdit('y') else: print 'JMSModule ' + jmsModule + ' does not exist, I will not delete it'
make sure you check for the existence of the MBean BEFORE you do the edit()... otherwise you will get an exception
No comments:
Post a Comment