def params_set(module):
 changed = False
 module.params['ovs-vsctl'] = module.get_bin_path('ovs-vsctl', True)
 fmt = '%(ovs-vsctl)s -t %(timeout)s get %(table)s %(record)s %(col)s:%(key)s'
 cmd = (fmt % module.params)
 (_, output, _) = cmd_run(module, cmd, False)
 if (module.params['value'] not in output):
  fmt = '%(ovs-vsctl)s -t %(timeout)s set %(table)s %(record)s %(col)s:%(key)s=%(value)s'
  cmd = (fmt % module.params)
  (rtc, _, err) = cmd_run(module, cmd)
  if (rtc != 0):
   module.fail_json(msg=err)
  changed = True
 module.exit_json(changed=changed)

def params_set ( module ) : changed = False module . params [ 'ovs-vsctl' ] = module . get_bin_path ( 'ovs-vsctl' , True ) fmt = '%(ovs-vsctl)s -t %(timeout)s get %(table)s %(record)s %(col)s:%(key)s' cmd = ( fmt % module . params ) ( _ , output , _ ) = cmd_run ( module , cmd , False ) if ( module . params [ 'value' ] not in output ) : fmt = '%(ovs-vsctl)s -t %(timeout)s set %(table)s %(record)s %(col)s:%(key)s=%(value)s' cmd = ( fmt % module . params ) ( rtc , _ , err ) = cmd_run ( module , cmd ) if ( rtc != 0 ) : module . fail_json ( msg = err ) changed = True module . exit_json ( changed = changed )
implement the ovs-vsctl set commands .