def ofctl_arg_supported(cmd, **kwargs):
 br_name = common_utils.get_rand_device_name(prefix='br-test-')
 with ovs_lib.OVSBridge(br_name) as test_br:
  full_args = ['ovs-ofctl', cmd, test_br.br_name, ovs_lib._build_flow_expr_str(kwargs, cmd.split('-')[0])]
  try:
   agent_utils.execute(full_args, run_as_root=True)
  except RuntimeError as e:
   LOG.debug('Exception while checking supported feature via command %s. Exception: %s', full_args, e)
   return False
  except Exception:
   LOG.exception(_LE('Unexpected exception while checking supported feature via command: %s'), full_args)
   return False
  else:
   return True

def ofctl_arg_supported ( cmd , ** kwargs ) : br_name = common_utils . get_rand_device_name ( prefix = 'br-test-' ) with ovs_lib . OVSBridge ( br_name ) as test_br : full_args = [ 'ovs-ofctl' , cmd , test_br . br_name , ovs_lib . _build_flow_expr_str ( kwargs , cmd . split ( '-' ) [ 0 ] ) ] try : agent_utils . execute ( full_args , run_as_root = True ) except RuntimeError as e : LOG . debug ( 'Exception while checking supported feature via command %s. Exception: %s' , full_args , e ) return False except Exception : LOG . exception ( _LE ( 'Unexpected exception while checking supported feature via command: %s' ) , full_args ) return False else : return True
verify if ovs-ofctl binary supports cmd with **kwargs .