#NEWLINE# def undeployed( name , url = 'http://localhost:8080/manager' , timeout = 180 ) : #NEWLINE# #INDENT# '\n    Enforce that the WAR will be un-deployed from the server\n\n    name\n        the context path to deploy\n    url : http://localhost:8080/manager\n        the URL of the server manager webapp\n    timeout : 180\n        timeout for HTTP request to the tomcat manager\n\n    Example:\n\n    .. code-block:: yaml\n\n        jenkins:\n          tomcat.undeployed:\n            - name: /ran\n            - require:\n              - service: application-service\n    ' #NEWLINE# ret = { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# 'result' : True , #NEWLINE# 'changes' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'comment' : '' , #NEWLINE# #UNINDENT# } #NEWLINE# if ( not __salt__ [ 'tomcat.status' ] ( url , timeout ) ) : #NEWLINE# #INDENT# ret [ 'comment' ] = 'Tomcat Manager does not response' #NEWLINE# ret [ 'result' ] = False #NEWLINE# return ret #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# version = __salt__ [ 'tomcat.ls' ] ( url , timeout ) [ name ] [ 'version' ] #NEWLINE# ret [ 'changes' ] = { #NEWLINE# #INDENT# 'undeploy' : version , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# return ret #NEWLINE# #UNINDENT# if __opts__ [ 'test' ] : #NEWLINE# #INDENT# ret [ 'result' ] = None #NEWLINE# return ret #NEWLINE# #UNINDENT# undeploy = __salt__ [ 'tomcat.undeploy' ] ( name , url , timeout = timeout ) #NEWLINE# if undeploy . startswith ( 'FAIL' ) : #NEWLINE# #INDENT# ret [ 'result' ] = False #NEWLINE# ret [ 'comment' ] = undeploy #NEWLINE# return ret #NEWLINE# #UNINDENT# return ret