#NEWLINE# def wait( name , url = 'http://localhost:8080/manager' , timeout = 180 ) : #NEWLINE# #INDENT# "\n    Wait for the tomcat manager to load\n\n    Notice that if tomcat is not running we won't wait for it start and the\n    state will fail. This state can be required in the tomcat.war_deployed\n    state to make sure tomcat is running and that the manager is running as\n    well and ready for deployment\n\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        tomcat-service:\n          service.running:\n            - name: tomcat\n            - enable: True\n\n        wait-for-tomcatmanager:\n          tomcat.wait:\n            - timeout: 300\n            - require:\n              - service: tomcat-service\n\n        jenkins:\n          tomcat.war_deployed:\n            - name: /ran\n            - war: salt://jenkins-1.2.4.war\n            - require:\n              - tomcat: wait-for-tomcatmanager\n    " #NEWLINE# result = __salt__ [ 'tomcat.status' ] ( url , timeout ) #NEWLINE# ret = { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# 'result' : result , #NEWLINE# 'changes' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'comment' : ( 'tomcat manager is ready' if result else 'tomcat manager is not ready' ) , #NEWLINE# #UNINDENT# } #NEWLINE# return ret