Revision 44bd008a snf-cyclades-app/synnefo/api/management/commands/subnet-create.py
b/snf-cyclades-app/synnefo/api/management/commands/subnet-create.py | ||
---|---|---|
63 | 63 |
help="IP allocation pools to be used for assigning IPs to" |
64 | 64 |
" VMs. Can be used multiple times. Syntax: \n" |
65 | 65 |
"192.168.42.220,192.168.42.240. Starting IP must proceed " |
66 |
"ending IP."), |
|
66 |
"ending IP.20,192.168.42.240. Starting IP must proceed " |
|
67 |
"ending IP. If no allocation pools are given, the whole " |
|
68 |
"subnet range is used, excluding the gateway IP, the " |
|
69 |
"broadcast address and the network address"), |
|
67 | 70 |
make_option("--name", dest="name", |
68 | 71 |
help="An arbitrary string for naming the subnet."), |
69 | 72 |
make_option("--ip-version", dest="ipversion", choices=["4", "6"], |
... | ... | |
110 | 113 |
dns = options["dns"] |
111 | 114 |
host_routes = options["host_routes"] |
112 | 115 |
|
113 |
alloc = subnets.parse_allocation_pools(allocation_pools) |
|
116 |
alloc = None |
|
117 |
if allocation_pools is not None: |
|
118 |
alloc = subnets.parse_allocation_pools(allocation_pools) |
|
119 |
alloc.sort() |
|
114 | 120 |
|
115 | 121 |
sub = subnets.create_subnet(name=name, |
116 | 122 |
network_id=network_id, |
117 | 123 |
cidr=cidr, |
118 |
allocation_pools=sorted(alloc),
|
|
124 |
allocation_pools=alloc,
|
|
119 | 125 |
gateway=gateway, |
120 | 126 |
ipversion=ipversion, |
121 | 127 |
dhcp=dhcp, |
Also available in: Unified diff