Example #1
0
def set_stp_state(stg_id, interface, state):
    obj = cps_object.CPSObject(module=nas_stg_utils.get_stg_keys()[0],
                               data={"switch-id": "0", "id": stg_id})
    el = ["intf", "0", "ifindex"]
    obj.add_embed_attr(el, nas_os_utils.if_nametoindex(interface))
    el[2] = "state"
    obj.add_embed_attr(el, port_state_map[state])
    nas_ut.get_cb_method("set")(obj)
Example #2
0
def set_stp_state(stg_id, interface, state):
    obj = cps_object.CPSObject(module=nas_stg_utils.get_stg_keys()[0],
                               data={
                                   "switch-id": "0",
                                   "id": stg_id
                               })
    el = ["intf", "0", "ifindex"]
    obj.add_embed_attr(el, nas_os_utils.if_nametoindex(interface))
    el[2] = "state"
    obj.add_embed_attr(el, port_state_map[state])
    nas_common.get_cb_method("set")(obj)
Example #3
0
def nas_stg_op(op, data_dict, type):
    obj = cps_object.CPSObject(module=nas_stg_utils.get_stg_keys()[int(type)],
                               data=data_dict)
    obj.add_attr("base-stg/entry/switch-id", "0")
    nas_common.get_cb_method(op)(obj)
Example #4
0
def nas_stg_op(op, data_dict, type):
    obj = cps_object.CPSObject(
        module=nas_stg_utils.get_stg_keys()[int(type)],
        data=data_dict)
    obj.add_attr("base-stg/entry/switch-id", "0")
    nas_ut.get_cb_method(op)(obj)