def _prepare_xml(options=None, state=None):
 if state:
  _state = '0'
 else:
  _state = '2'
 xml = "<?xml version='1.0'?>\n<checkresults>\n"
 if (('service' in options) and (options['service'] != '')):
  xml += (("<checkresult type='service' checktype='" + str(options['checktype'])) + "'>")
  xml += (('<hostname>' + cgi.escape(options['hostname'], True)) + '</hostname>')
  xml += (('<servicename>' + cgi.escape(options['service'], True)) + '</servicename>')
 else:
  xml += (("<checkresult type='host' checktype='" + str(options['checktype'])) + "'>")
  xml += (('<hostname>' + cgi.escape(options['hostname'], True)) + '</hostname>')
 xml += (('<state>' + _state) + '</state>')
 if ('output' in options):
  xml += (('<output>' + cgi.escape(options['output'], True)) + '</output>')
 xml += '</checkresult>'
 xml += '\n</checkresults>'
 return xml

def _prepare_xml ( options = None , state = None ) : if state : _state = '0' else : _state = '2' xml = "<?xml version='1.0'?>\n<checkresults>\n" if ( ( 'service' in options ) and ( options [ 'service' ] != '' ) ) : xml += ( ( "<checkresult type='service' checktype='" + str ( options [ 'checktype' ] ) ) + "'>" ) xml += ( ( '<hostname>' + cgi . escape ( options [ 'hostname' ] , True ) ) + '</hostname>' ) xml += ( ( '<servicename>' + cgi . escape ( options [ 'service' ] , True ) ) + '</servicename>' ) else : xml += ( ( "<checkresult type='host' checktype='" + str ( options [ 'checktype' ] ) ) + "'>" ) xml += ( ( '<hostname>' + cgi . escape ( options [ 'hostname' ] , True ) ) + '</hostname>' ) xml += ( ( '<state>' + _state ) + '</state>' ) if ( 'output' in options ) : xml += ( ( '<output>' + cgi . escape ( options [ 'output' ] , True ) ) + '</output>' ) xml += '</checkresult>' xml += '\n</checkresults>' return xml
get the requests options from salt .