(key, value)
Sets the key to the vale
        @param key is the configuration key
        @param value is what to set it to
Sets the key to the vale
Sets the key to the vale
def set(key, value):
    """ Sets the key to the vale
        @param key is the configuration key
        @param value is what to set it to
    """
    global CONFIG
    if key in CONFIG.opts:
        # sometimes we gotta do stuff with the key
        if key == 'iface':
            if not util.verify_iface(value):
                util.Error('\'%s\' is not a valid interface.' % (value))
                return

            # valid iface, set new ipconfig
            new_ip = util.get_local_ip(value)
            if new_ip is not None:
                set('iface',value)
                set('ip_addr', new_ip)
        else:
            res = util.eval_type(value, CONFIG.opts[key]['type'])
            if res[0]:
                CONFIG.opts[key]['value'] = res[1]
    elif key in CONFIG._opts:
        # options not available in CLI
        res = util.eval_type(value, CONFIG._opts[key]['type'])
        if res[0]:
            CONFIG._opts[key]['value'] = res[1]
        else:
            return
    else:
        util.Error('Key "%s" not found.  \'opts\' for options.' % (key))
def set ( key , value ) : global CONFIG if key in CONFIG . opts : # sometimes we gotta do stuff with the key if key == 'iface' : if not util . verify_iface ( value ) : util . Error ( '\'%s\' is not a valid interface.' % ( value ) ) return # valid iface, set new ipconfig new_ip = util . get_local_ip ( value ) if new_ip is not None : set ( 'iface' , value ) set ( 'ip_addr' , new_ip ) else : res = util . eval_type ( value , CONFIG . opts [ key ] [ 'type' ] ) if res [ 0 ] : CONFIG . opts [ key ] [ 'value' ] = res [ 1 ] elif key in CONFIG . _opts : # options not available in CLI res = util . eval_type ( value , CONFIG . _opts [ key ] [ 'type' ] ) if res [ 0 ] : CONFIG . _opts [ key ] [ 'value' ] = res [ 1 ] else : return else : util . Error ( 'Key "%s" not found.  \'opts\' for options.' % ( key ) )