def deployed(name, jboss_config, salt_source=None):
 log.debug(' ======================== STATE: jboss7.deployed (name: %s) ', name)
 ret = {'name': name, 'result': True, 'changes': {}, 'comment': ''}
 comment = ''
 (validate_success, validate_comment) = __validate_arguments(jboss_config, salt_source)
 if (not validate_success):
  return _error(ret, validate_comment)
 (resolved_source, get_artifact_comment) = __get_artifact(salt_source)
 log.debug('resolved_source=%s', resolved_source)
 log.debug('get_artifact_comment=%s', get_artifact_comment)
 comment = __append_comment(new_comment=get_artifact_comment, current_comment=comment)
 if (resolved_source is None):
  return _error(ret, get_artifact_comment)
 (find_success, deployment, find_comment) = __find_deployment(jboss_config, salt_source)
 if (not find_success):
  return _error(ret, find_comment)
 log.debug('deployment=%s', deployment)
 if (deployment is not None):
  __salt__['jboss7.undeploy'](jboss_config, deployment)
  ret['changes']['undeployed'] = deployment
 deploy_result = __salt__['jboss7.deploy'](jboss_config=jboss_config, source_file=resolved_source)
 log.debug('deploy_result=%s', str(deploy_result))
 if deploy_result['success']:
  comment = __append_comment(new_comment='Deployment completed.', current_comment=comment)
  ret['comment'] = comment
  ret['changes']['deployed'] = resolved_source
 else:
  comment = __append_comment(new_comment="Deployment failed\nreturn code={retcode}\nstdout='{stdout}'\nstderr='{stderr}".format(**deploy_result), current_comment=comment)
  return _error(ret, comment)
 return ret

def deployed ( name , jboss_config , salt_source = None ) : log . debug ( ' ======================== STATE: jboss7.deployed (name: %s) ' , name ) ret = { 'name' : name , 'result' : True , 'changes' : { } , 'comment' : '' } comment = '' ( validate_success , validate_comment ) = __validate_arguments ( jboss_config , salt_source ) if ( not validate_success ) : return _error ( ret , validate_comment ) ( resolved_source , get_artifact_comment ) = __get_artifact ( salt_source ) log . debug ( 'resolved_source=%s' , resolved_source ) log . debug ( 'get_artifact_comment=%s' , get_artifact_comment ) comment = __append_comment ( new_comment = get_artifact_comment , current_comment = comment ) if ( resolved_source is None ) : return _error ( ret , get_artifact_comment ) ( find_success , deployment , find_comment ) = __find_deployment ( jboss_config , salt_source ) if ( not find_success ) : return _error ( ret , find_comment ) log . debug ( 'deployment=%s' , deployment ) if ( deployment is not None ) : __salt__ [ 'jboss7.undeploy' ] ( jboss_config , deployment ) ret [ 'changes' ] [ 'undeployed' ] = deployment deploy_result = __salt__ [ 'jboss7.deploy' ] ( jboss_config = jboss_config , source_file = resolved_source ) log . debug ( 'deploy_result=%s' , str ( deploy_result ) ) if deploy_result [ 'success' ] : comment = __append_comment ( new_comment = 'Deployment completed.' , current_comment = comment ) ret [ 'comment' ] = comment ret [ 'changes' ] [ 'deployed' ] = resolved_source else : comment = __append_comment ( new_comment = "Deployment failed\nreturn code={retcode}\nstdout='{stdout}'\nstderr='{stderr}" . format ( ** deploy_result ) , current_comment = comment ) return _error ( ret , comment ) return ret
ensure the website has been deployed .