Revision 5aeb4e93 snf-cyclades-app/synnefo/api/management/commands/network-create.py
b/snf-cyclades-app/synnefo/api/management/commands/network-create.py | ||
---|---|---|
149 | 149 |
dry_run = options["dry_run"] |
150 | 150 |
name = options['name'] |
151 | 151 |
subnet = options['subnet'] |
152 |
gateway = options['gateway'] |
|
153 |
subnet6 = options['subnet6'] |
|
154 |
gateway6 = options['gateway6'] |
|
152 | 155 |
backend_id = options['backend_id'] |
153 | 156 |
public = options['public'] |
154 | 157 |
flavor = options['flavor'] |
... | ... | |
160 | 163 |
floating_ip_pool = parse_bool(options["floating_ip_pool"]) |
161 | 164 |
|
162 | 165 |
if not name: |
163 |
raise CommandError("Name is required") |
|
164 |
if not subnet: |
|
165 |
raise CommandError("Subnet is required") |
|
166 |
raise CommandError("name is required") |
|
166 | 167 |
if not flavor: |
167 |
raise CommandError("Flavor is required") |
|
168 |
raise CommandError("flavor is required") |
|
169 |
|
|
170 |
if (subnet is None) and (subnet6 is None): |
|
171 |
raise CommandError("subnet or subnet6 is required") |
|
172 |
if subnet is None and gateway is not None: |
|
173 |
raise CommandError("Can not use gateway without subnet") |
|
174 |
if subnet6 is None and gateway6 is not None: |
|
175 |
raise CommandError("Can not use gateway6 without subnet6") |
|
176 |
|
|
168 | 177 |
if public and not (backend_id or floating_ip_pool): |
169 | 178 |
raise CommandError("backend-id is required") |
170 | 179 |
if not userid and not public: |
Also available in: Unified diff