def create_interface(obj):

    ifobj = nas_if.make_interface_from_phy_port(obj)

    if if_cache.exists(ifobj.get_attr_data('if/interfaces/interface/name')):
        nas_if.log_err("Already exists.... " + str(ifobj.get_attr_data('if/interfaces/interface/name')))
        return

    # create the object
    ch = {'operation': 'rpc', 'change': ifobj.get()}
    cps.transaction([ch])
    nas_if.log_info("Interface Created : " + str(ifobj.get_attr_data('if/interfaces/interface/name')))
def create_interface(obj):

    ifobj = nas_if.make_interface_from_phy_port(obj)

    if if_cache.exists(ifobj.get_attr_data('if/interfaces/interface/name')):
        print "Already exists.... " + ifobj.get_attr_data('if/interfaces/interface/name')
        return

    # create the object
    ch = {'operation': 'rpc', 'change': ifobj.get()}
    cps.transaction([ch])
    print "Interface Created : " + ifobj.get_attr_data('if/interfaces/interface/name')
    cps_utils.print_obj(ch['change'])
Exemplo n.º 3
0
def create_interface(obj):

    ifobj = nas_if.make_interface_from_phy_port(obj)

    if if_cache.exists(ifobj.get_attr_data('if/interfaces/interface/name')):
        print "Already exists.... " + ifobj.get_attr_data(
            'if/interfaces/interface/name')
        return

    # create the object
    ch = {'operation': 'rpc', 'change': ifobj.get()}
    cps.transaction([ch])
    print "Interface Created : " + ifobj.get_attr_data(
        'if/interfaces/interface/name')
    cps_utils.print_obj(ch['change'])