def init_validations(bs):
    global bigsh
    bigsh = bs

    # Initialize validation functions
    command.add_validation('validate-string', validate_string)
    command.add_validation('validate-integer', validate_integer)
    command.add_validation('validate-hex-or-dec-integer', validate_hex_or_dec_integer)
    command.add_validation('validate-netmask', validate_netmask)
    command.add_validation('validate-inverse-netmask', validate_inverse_netmask)
    command.add_validation('validate-ip-address-not-mask', validate_ip_address_not_netmask)
    command.add_validation('validate-cidr-range', validate_cidr_range)
    command.add_validation('validate-resolvable-ip-address',
                            validate_resolvable_ip_address)
    command.add_validation('validate-identifier', validate_identifier,
                           {'kwargs': {'typedef'  : '$typedef',
                                       'value'    : '$value',
                                       'reserved' : '$reserved'}})
    command.add_validation('validate-date', validate_date)
    command.add_validation('validate-duration', validate_duration)
    command.add_validation('validate-enum', validate_enum)
    command.add_validation('validate-mac-address', validate_mac_address)
    command.add_validation('validate-host', validate_host)
    command.add_validation('validate-switch-dpid', validate_switch_dpid)
    command.add_validation('validate-controller-node', validate_controller_node)
    command.add_validation('validate-existing-obj', validate_existing_obj,
                        {'kwargs': {'typedef'   : '$typedef',
                                    'value'     : '$value',
                                    'data'      : '$data',
                                    'path'      : '$path', }})
    command.add_validation('validate-config', validate_config)
    command.add_validation('validate-not-reserved', validate_not_reserved,
                           {'kwargs' : {'typedef'  : '$typedef',
                                        'value'    : '$value',
                                        'reserved' : '$reserved'}})

    command.add_validation('validate-integer-comma-ranges',
                           validate_integer_comma_ranges,
                           {'kwargs' : {'typedef'  : '$typedef',
                                        'value'    : '$value', }})
def init_validations(bs, modi):
    global sdnsh, mi
    sdnsh = bs
    mi = modi

    # Initialize validation functions
    command.add_validation('validate-string', validate_string)
    command.add_validation('validate-integer', validate_integer)
    command.add_validation('validate-hex-or-dec-integer', validate_hex_or_dec_integer)
    command.add_validation('validate-netmask', validate_netmask)
    command.add_validation('validate-inverse-netmask', validate_inverse_netmask)
    command.add_validation('validate-ip-address-not-mask', validate_ip_address_not_netmask)
    command.add_validation('validate-cidr-range', validate_cidr_range)
    command.add_validation('validate-resolvable-ip-address',
                            validate_resolvable_ip_address)
    command.add_validation('validate-identifier', validate_identifier,
                           {'kwargs': {'typedef'   : '$typedef',
                                       'value'    : '$value',
                                       'reserved' : '$reserved'}})
    command.add_validation('validate-date', validate_date)
    command.add_validation('validate-duration', validate_duration)
    command.add_validation('validate-enum', validate_enum)
    command.add_validation('validate-mac-address', validate_mac_address)
    command.add_validation('validate-host', validate_host)
    command.add_validation('validate-switch-dpid', validate_switch_dpid)
    command.add_validation('validate-existing-obj', validate_existing_obj,
                        {'kwargs': {'typedef'   : '$typedef',
                                    'value'    : '$value',
                                    'obj_type' : '$obj_type'}})
    command.add_validation('validate-config', validate_config)
Beispiel #3
0
def init_validations(bs, modi):
    global sdnsh, mi
    sdnsh = bs
    mi = modi

    # Initialize validation functions
    command.add_validation('validate-string', validate_string)
    command.add_validation('validate-integer', validate_integer)
    command.add_validation('validate-hex-or-dec-integer',
                           validate_hex_or_dec_integer)
    command.add_validation('validate-netmask', validate_netmask)
    command.add_validation('validate-inverse-netmask',
                           validate_inverse_netmask)
    command.add_validation('validate-ip-address-not-mask',
                           validate_ip_address_not_netmask)
    command.add_validation('validate-cidr-range', validate_cidr_range)
    command.add_validation('validate-resolvable-ip-address',
                           validate_resolvable_ip_address)
    command.add_validation(
        'validate-identifier', validate_identifier, {
            'kwargs': {
                'typedef': '$typedef',
                'value': '$value',
                'reserved': '$reserved'
            }
        })
    command.add_validation('validate-date', validate_date)
    command.add_validation('validate-duration', validate_duration)
    command.add_validation('validate-enum', validate_enum)
    command.add_validation('validate-mac-address', validate_mac_address)
    command.add_validation('validate-host', validate_host)
    command.add_validation('validate-switch-dpid', validate_switch_dpid)
    command.add_validation(
        'validate-existing-obj', validate_existing_obj, {
            'kwargs': {
                'typedef': '$typedef',
                'value': '$value',
                'obj_type': '$obj_type'
            }
        })
    command.add_validation('validate-config', validate_config)