Skip to content
Snippets Groups Projects
Commit a2356db9 authored by JORGE SASIAIN's avatar JORGE SASIAIN
Browse files

NAT-186: comment unused code

parent db0f1613
No related branches found
No related tags found
2 merge requests!27Merge develop into NAT-185,!15Nat 185
......@@ -57,24 +57,25 @@ def new_service_host(hostname,
extattrs=extattrs)
'''
if __name__ == '__main__':
# sample call flow to allocate two loopback interfaces and a trunk service
# new_service_host can be called passing networks or addresses
# - host h3 for service LO uses a specific ipv4/ipv6 address pair
# - host h1 for service LO uses a specific ipv4/ipv6 address pair
# - the rest use the ipv4/ipv6 network pair
# networks and hosts can be allocated with extensible attributes
# - host h4 for service LO uses extattrs for both network and address/DNS
# - host h2 for service LO uses extattrs for both network and address/DNS
# - the rest don't use extattrs
# CNAME records can be optionally created
# - hosts for service TRUNK use some alias names
hostname_A = 'h3'
hostname_B = 'h4'
hostname_A = 'h1'
hostname_B = 'h2'
# h3 LO (loopback)
# h1 LO (loopback)
lo1_service_networks = new_service_networks(
service_type='LO',
comment="Network for h3 LO"
comment="Network for h1 LO"
)
lo1_v4_host_address = lo1_service_networks.v4.network_address
lo1_v6_host_address = lo1_service_networks.v6.network_address
......@@ -84,7 +85,7 @@ if __name__ == '__main__':
service_type='LO',
host_addresses=lo1_host_addresses)
# h4 LO (loopback)
# h2 LO (loopback)
lo2_network_extattrs = {
"vrf_name": {"value": "dummy_vrf"},
}
......@@ -93,23 +94,24 @@ if __name__ == '__main__':
}
lo2_service_networks = \
new_service_networks(service_type='LO',
comment="Network for h4 LO",
comment="Network for h2 LO",
extattrs=lo2_network_extattrs)
new_service_host(hostname=hostname_B+"_LO",
service_type='LO',
service_networks=lo2_service_networks,
extattrs=lo2_host_extattrs)
# h3-h4 TRUNK
# h1-h2 TRUNK
trunk12_service_networks = new_service_networks(
service_type='TRUNK',
comment="Network for h3-h4 TRUNK"
comment="Network for h1-h2 TRUNK"
)
new_service_host(hostname=hostname_A+"_TRUNK",
service_type='TRUNK',
cname_aliases=["alias1.h3", "alias2.h3"],
cname_aliases=["alias1.h1", "alias2.h1"],
service_networks=trunk12_service_networks)
new_service_host(hostname=hostname_B+"_TRUNK",
service_type='TRUNK',
cname_aliases=["alias1.h4"],
cname_aliases=["alias1.h2"],
service_networks=trunk12_service_networks)
'''
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment