Revision d193a5c8 snf-cyclades-app/synnefo/logic/management/commands/network-create.py
b/snf-cyclades-app/synnefo/logic/management/commands/network-create.py | ||
---|---|---|
138 | 138 |
"ending IP. If no allocation pools are given, the whole " |
139 | 139 |
"subnet range is used, excluding the gateway IP, the " |
140 | 140 |
"broadcast address and the network address"), |
141 |
make_option( |
|
142 |
"--drained", |
|
143 |
dest="drained", |
|
144 |
metavar="True|False", |
|
145 |
choices=["True", "False"], |
|
146 |
default="False", |
|
147 |
help="Set network as drained to prevent creation of new ports."), |
|
141 | 148 |
) |
142 | 149 |
|
143 | 150 |
@convert_api_faults |
... | ... | |
160 | 167 |
allocation_pools = options["allocation_pools"] |
161 | 168 |
floating_ip_pool = parse_bool(options["floating_ip_pool"]) |
162 | 169 |
dhcp = parse_bool(options["dhcp"]) |
170 |
drained = parse_bool(options["drained"]) |
|
163 | 171 |
|
164 | 172 |
if name is None: |
165 | 173 |
name = "" |
... | ... | |
182 | 190 |
network = networks.create(userid=userid, name=name, flavor=flavor, |
183 | 191 |
public=public, mode=mode, |
184 | 192 |
link=link, mac_prefix=mac_prefix, tags=tags, |
185 |
floating_ip_pool=floating_ip_pool) |
|
193 |
floating_ip_pool=floating_ip_pool, |
|
194 |
drained=drained) |
|
186 | 195 |
|
187 | 196 |
if subnet is not None: |
188 | 197 |
alloc = None |
Also available in: Unified diff