def py_to_val(pyval):
 if isinstance(pyval, bool):
  return ('true' if (pyval is True) else 'false')
 elif (pyval == ''):
  return '""'
 else:
  return getattr(pyval, 'record_id', pyval)

def py_to_val ( pyval ) : if isinstance ( pyval , bool ) : return ( 'true' if ( pyval is True ) else 'false' ) elif ( pyval == '' ) : return '""' else : return getattr ( pyval , 'record_id' , pyval )
convert python value to ovs-vsctl value argument .