Revision 909ae594
b/kamaki/cli/commands/network.py | ||
---|---|---|
481 | 481 |
class _port_create(_init_network, _optional_json, _port_wait): |
482 | 482 |
|
483 | 483 |
def connect(self, network_id, device_id): |
484 |
fixed_ips = [dict( |
|
485 |
subnet_id=self['subnet_id'], ip_address=self['ip_address'])] if ( |
|
486 |
self['subnet_id']) else None |
|
484 |
fixed_ips = [dict(ip_address=self['ip_address'])] if ( |
|
485 |
self['subnet_id']) else None |
|
486 |
if fixed_ips and self['subnet_id']: |
|
487 |
fixed_ips[0]['subnet_id'] = self['subnet_id'] |
|
487 | 488 |
r = self.client.create_port( |
488 | 489 |
network_id, device_id, |
489 | 490 |
name=self['name'], |
... | ... | |
508 | 509 |
'Subnet id for fixed ips (used with --ip-address)', |
509 | 510 |
'--subnet-id'), |
510 | 511 |
ip_address=ValueArgument( |
511 |
'IP address for subnet id (used with --subnet-id', '--ip-address'),
|
|
512 |
'IP address for subnet id', '--ip-address'), |
|
512 | 513 |
network_id=ValueArgument('Set the network ID', '--network-id'), |
513 | 514 |
device_id=ValueArgument( |
514 | 515 |
'The device is either a virtual server or a virtual router', |
Also available in: Unified diff