Revision 56d84a4e kamaki/cli/commands/network.py
b/kamaki/cli/commands/network.py | ||
---|---|---|
456 | 456 |
@errors.cyclades.connection |
457 | 457 |
@errors.cyclades.network_id |
458 | 458 |
def _run(self, network_id, device_id): |
459 |
if not (bool(self['subnet_id']) ^ bool(self['ip_address'])):
|
|
459 |
if bool(self['subnet_id']) != bool(self['ip_address']):
|
|
460 | 460 |
raise CLIInvalidArgument('Invalid use of arguments', details=[ |
461 |
'--subned-id and --ip-address should be used together'])
|
|
462 |
fixed_ips = dict( |
|
463 |
subnet_id=self['subnet_id'], ip_address=self['ip_address']) if ( |
|
461 |
'--subnet-id and --ip-address should be used together'])
|
|
462 |
fixed_ips = [dict(
|
|
463 |
subnet_id=self['subnet_id'], ip_address=self['ip_address'])] if (
|
|
464 | 464 |
self['subnet_id']) else None |
465 | 465 |
r = self.client.create_port( |
466 | 466 |
network_id, device_id, |
Also available in: Unified diff