def commit_transaction(hostname, username, password, label):
 bigip_session = _build_session(username, password)
 trans_id = __salt__['grains.get']('bigip_f5_trans:{label}'.format(label=label))
 if trans_id:
  payload = {}
  payload['state'] = 'VALIDATING'
  try:
   response = bigip_session.patch((BIG_IP_URL_BASE.format(host=hostname) + '/transaction/{trans_id}'.format(trans_id=trans_id)), data=json.dumps(payload))
   return _load_response(response)
  except requests.exceptions.ConnectionError as e:
   return _load_connection_error(hostname, e)
 else:
  return 'Error: the label for this transaction was not defined as a grain.  Begin a new transaction using the bigip.start_transaction function'

def commit_transaction ( hostname , username , password , label ) : bigip_session = _build_session ( username , password ) trans_id = __salt__ [ 'grains.get' ] ( 'bigip_f5_trans:{label}' . format ( label = label ) ) if trans_id : payload = { } payload [ 'state' ] = 'VALIDATING' try : response = bigip_session . patch ( ( BIG_IP_URL_BASE . format ( host = hostname ) + '/transaction/{trans_id}' . format ( trans_id = trans_id ) ) , data = json . dumps ( payload ) ) return _load_response ( response ) except requests . exceptions . ConnectionError as e : return _load_connection_error ( hostname , e ) else : return 'Error: the label for this transaction was not defined as a grain.  Begin a new transaction using the bigip.start_transaction function'
a function to connect to a bigip device and commit an existing transaction .