def undeployed(name, url='http://localhost:8080/manager', timeout=180):
 ret = {'name': name, 'result': True, 'changes': {}, 'comment': ''}
 if (not __salt__['tomcat.status'](url, timeout)):
  ret['comment'] = 'Tomcat Manager does not respond'
  ret['result'] = False
  return ret
 try:
  version = __salt__['tomcat.ls'](url, timeout)[name]['version']
  ret['changes'] = {'undeploy': version}
 except KeyError:
  return ret
 if __opts__['test']:
  ret['result'] = None
  return ret
 undeploy = __salt__['tomcat.undeploy'](name, url, timeout=timeout)
 if undeploy.startswith('FAIL'):
  ret['result'] = False
  ret['comment'] = undeploy
  return ret
 return ret

def undeployed ( name , url = 'http://localhost:8080/manager' , timeout = 180 ) : ret = { 'name' : name , 'result' : True , 'changes' : { } , 'comment' : '' } if ( not __salt__ [ 'tomcat.status' ] ( url , timeout ) ) : ret [ 'comment' ] = 'Tomcat Manager does not respond' ret [ 'result' ] = False return ret try : version = __salt__ [ 'tomcat.ls' ] ( url , timeout ) [ name ] [ 'version' ] ret [ 'changes' ] = { 'undeploy' : version } except KeyError : return ret if __opts__ [ 'test' ] : ret [ 'result' ] = None return ret undeploy = __salt__ [ 'tomcat.undeploy' ] ( name , url , timeout = timeout ) if undeploy . startswith ( 'FAIL' ) : ret [ 'result' ] = False ret [ 'comment' ] = undeploy return ret return ret
enforce that the war will be undeployed from the server name the context path to undeploy .