def check_status():
 return (salt.utils.http.query('http://github.com', status=True)['status'] == 200)

def check_status ( ) : return ( salt . utils . http . query ( 'http://github.com' , status = True ) [ 'status' ] == 200 )
a little helper function that checks an api error code and returns a nice message .