15d996f7e4
Due to the change in the neutron API wrapper [1],
admin cannot create a port on networks owned by different project.
This is because api.neutron.network_get returns subnet detail
(Subnet object) only when project_id matches that of a target network.
This commit changes the logic to try to retrieve subnet detail first.
The condition is not simple and it looks wise to let neutron decide it.
The error reported in the bug also happens in the Port Create form
in the project dashboard if a user tries to create a port on an
external network. To handle the situation, handle() in CreatePort form
honors whether subnet detail is retrieved or not by checking a subnet
information is an instance of api.neutron.Subnet class.
This is a bit tricky but considering the current policy for create_port
I believe it is a good compromise.
Also fixes the wrong initial value of 'specify_ip' field of CreatePort
form. The initial value should be one of choices or None. Otherwise,
when 'specify_ip' field is hidden, an error message is returned
(though the message is not visible in the form), a user cannot submit
the form and the form is displayed continuously....
[1] commit
|
||
---|---|---|
.. | ||
__init__.py | ||
base_tests.py | ||
cinder_rest_tests.py | ||
cinder_tests.py | ||
config_rest_tests.py | ||
glance_rest_tests.py | ||
glance_tests.py | ||
heat_rest_tests.py | ||
heat_tests.py | ||
keystone_rest_tests.py | ||
keystone_tests.py | ||
network_rest_tests.py | ||
network_tests.py | ||
neutron_rest_tests.py | ||
neutron_tests.py | ||
nova_rest_tests.py | ||
nova_tests.py | ||
policy_rest_tests.py | ||
rest_util_tests.py | ||
swift_rest_tests.py | ||
swift_tests.py |