← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1645708] Re: Can't create Port as Admin on an unshared Network in another project

 

Reviewed:  https://review.openstack.org/465778
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=15d996f7e421c7de9ab4e87333a3c9824b307e5e
Submitter: Jenkins
Branch:    master

commit 15d996f7e421c7de9ab4e87333a3c9824b307e5e
Author: Akihiro Motoki <amotoki@xxxxxxxxx>
Date:   Wed May 17 20:14:12 2017 +0000

    Allow admin to create port on networks of different projects
    
    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 803209e237ea2987cfa2fad5f0e07a8c30d6d901
    
    Closes-Bug: #1645708
    Change-Id: I6aae0a29eedebc920247912fec0729bf47cda002


** Changed in: horizon
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1645708

Title:
  Can't create Port as Admin on an unshared Network in another project

Status in OpenStack Dashboard (Horizon):
  Fix Released

Bug description:
  https://github.com/openstack/horizon/blob/master/openstack_dashboard/api/neutron.py#L675
  alters the network[subnets] value to be a list of Subnet objects
  instead of a list of unicode strings. Since the calling code has no
  idea what it will get back (thanks Python), it breaks in strange ways.

  Specifically, the Create Port form expects a list of Subnet objects,
  not a list of strings and so falls about laughing
  https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/admin/networks/ports/forms.py#L150

  The easiest way to recreate this is a standard devstack, log in as
  Admin, try to create a Port on the default Private network.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1645708/+subscriptions


References