Admin can't override default "distributed" flags

Bug #1664255 reported by venkata anil on 2017-02-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
Undecided
venkata anil

Bug Description

neutron.conf allows system-wide flag for creating distributed router.

Below description is from neutron.conf
# System-wide flag to determine the type of router that tenants can create.
# Only admin can override. (boolean value)
#router_distributed = false

But admin is allowed to override this flag while creating the router, for example, with neutron client
neutron router-create --distributed=False test1

But this overriding is not possible with openstack client as it won't allow --distributed=False.
So when "router_distributed=True" is set in neutron.conf, admin can't override with --distributed flag(can't create non-distributed router)
1) openstack router create --distributed test1
REQ: curl -g -i -X POST http://172.18.160.19:9696/v2.0/routers -H "User-Agent: openstacksdk/0.9.13 keystoneauth1/2.18.0 python-requests/2.12.5 CPython/2.7.6" -H "Content-Type: application/json" -H "X-Auth-Token: {SHA1}aa411d29f41e0e022610a282499473c81029a898" -d '{"router": {"distributed": true, "name": "test1", "admin_state_up": true}}'

2) openstack router create test2
REQ: curl -g -i -X POST http://172.18.160.19:9696/v2.0/routers -H "User-Agent: openstacksdk/0.9.13 keystoneauth1/2.18.0 python-requests/2.12.5 CPython/2.7.6" -H "Content-Type: application/json" -H "X-Auth-Token: {SHA1}4a7e8060f5527eee47845665c58a4249266a5ee3" -d '{"router": {"name": "test2", "admin_state_up": true}}'

vagrant@16gb:~/devstack$ openstack router create
usage: openstack router create [-h] [-f {json,shell,table,value,yaml}]
                               [-c COLUMN] [--max-width <integer>]
                               [--print-empty] [--noindent] [--prefix PREFIX]
                               [--enable | --disable] [--distributed] [--ha]
                               [--description <description>]
                               [--project <project>]
                               [--project-domain <project-domain>]
                               [--availability-zone-hint <availability-zone>]
                               <name>
openstack router create: error: too few arguments

vagrant@16gb:~/devstack$ openstack --version
openstack 3.8.1

Changed in python-openstackclient:
assignee: nobody → venkata anil (anil-venkata)
Changed in python-openstackclient:
status: New → Invalid
venkata anil (anil-venkata) wrote :

It is still a bug. Openstack client has the provision to change router to "distributed" or "centralized" after creation using "set" command, but during creation admin can't override default behavior.

vagrant@16gb:~/devstack$ openstack router set
usage: openstack router set [-h] [--name <name>] [--description <description>]
                            [--enable | --disable]
                            [--distributed | --centralized]
                            [--route destination=<subnet>,gateway=<ip-address>]
                            [--no-route] [--ha | --no-ha]
                            [--external-gateway <network>]
                            [--fixed-ip subnet=<subnet>,ip-address=<ip-address>]
                            [--enable-snat | --disable-snat]
                            <router>
openstack router set: error: too few arguments

Changed in python-openstackclient:
status: Invalid → New

Fix proposed to branch: master
Review: https://review.openstack.org/433442

Changed in python-openstackclient:
status: New → In Progress

Change abandoned by Ihar Hrachyshka (<email address hidden>) on branch: stable/mitaka
Review: https://review.openstack.org/433457

Dr. Jens Harbott (j-harbott) wrote :

I am having the same issue for creating a non-ha router, just doing "router create r1" creates a router with ha:true, setting the --ha option doesn't change that, would need a --no-ha option for "router create" as well.

Reviewed: https://review.openstack.org/433442
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=fe59e339ae6dd6a5e9075773fb5c2a0fea9c2e53
Submitter: Jenkins
Branch: master

commit fe59e339ae6dd6a5e9075773fb5c2a0fea9c2e53
Author: venkata anil <email address hidden>
Date: Tue Feb 14 05:05:20 2017 +0000

    Allow override of distributed router flag

    When router_distributed=True is set in neutron.conf,
    user can't override this and create a centralized router
    through openstack client. Openstack client allows modifying
    routers from distributed to centralized after creation but
    not supporting centralized flag during creation. We allow
    centralized and distributed flags during router creation
    with this change.

    Closes-bug: #1664255
    Change-Id: I75f72ca695338ad8c381cfa89fbb9d8e61ee7bc5

Changed in python-openstackclient:
status: In Progress → Fix Released

This issue was fixed in the openstack/python-openstackclient 3.10.0 release.

Change abandoned by venkata anil (<email address hidden>) on branch: stable/newton
Review: https://review.openstack.org/433452
Reason: As this is not allowed for backport.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers