Revision 2a58c29b
b/snf-cyclades-app/synnefo/api/management/commands/port-create.py | ||
---|---|---|
123 | 123 |
if not network_id: |
124 | 124 |
raise CommandError("Please specify a 'network'") |
125 | 125 |
|
126 |
if user_id is None: |
|
127 |
raise CommandError("Please specify the owner of the port") |
|
128 |
|
|
129 | 126 |
vm = None |
130 | 127 |
owner = None |
131 | 128 |
if server_id: |
... | ... | |
139 | 136 |
if not vm.router: |
140 | 137 |
raise CommandError("Router '%s' does not exist." % router_id) |
141 | 138 |
|
139 |
if user_id is None: |
|
140 |
if vm is not None: |
|
141 |
user_id = vm.userid |
|
142 |
else: |
|
143 |
raise CommandError("Please specify the owner of the port.") |
|
144 |
|
|
142 | 145 |
# get the network |
143 | 146 |
network = common.get_network(network_id) |
144 | 147 |
|
Also available in: Unified diff