mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-30 04:33:00 +02:00
yanger: introduce main function
Signed-off-by: Richard Alpe <richard@bit42.se>
This commit is contained in:
committed by
Joachim Wiberg
parent
5038cd47e5
commit
5f25c063d5
@@ -526,11 +526,11 @@ def add_ip_link(ifname, iface_out, test):
|
||||
if 'master' in iface_in:
|
||||
insert(iface_out, "infix-interfaces:bridge-port", "bridge", iface_in['master'])
|
||||
|
||||
pvid = get_bridge_port_pvid(ifname, iface_out, args.test)
|
||||
pvid = get_bridge_port_pvid(ifname, iface_out, test)
|
||||
if pvid is not None:
|
||||
insert(iface_out, "infix-interfaces:bridge-port", "pvid", pvid)
|
||||
|
||||
stp_state = get_bridge_port_stp_state(ifname, iface_out, args.test)
|
||||
stp_state = get_bridge_port_stp_state(ifname, iface_out, test)
|
||||
if stp_state is not None:
|
||||
insert(iface_out, "infix-interfaces:bridge-port", "stp-state", stp_state)
|
||||
|
||||
@@ -770,7 +770,7 @@ def add_vlans_to_bridge(brname, iface_out, test):
|
||||
|
||||
insert(iface_out, "infix-interfaces:bridge", "vlans", "vlan", vlans)
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="YANG data creator")
|
||||
parser.add_argument("model", help="YANG Model")
|
||||
parser.add_argument("-p", "--param", default=None, help="Model dependant parameter")
|
||||
@@ -865,3 +865,6 @@ if __name__ == "__main__":
|
||||
sys.exit(1)
|
||||
|
||||
print(json.dumps(yang_data, indent=2))
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user