Policy file is read before configuration parsed with designate-manage command

Bug #1519356 reported by Kiall Mac Innes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Designate
Fix Released
High
Kiall Mac Innes
Liberty
Fix Committed
High
Kiall Mac Innes

Bug Description

With the designate-manage command, the policy file is read before the configuration is parsed.

If the policy file is in a non-default location, all designate-manage commands will fail with:

    $ designate-manage --help
    Traceback (most recent call last):
      File "/home/macinnek/HP/gozer/designate/.tox/py27/bin/designate-manage", line 10, in <module>
        sys.exit(main())
      File "/home/macinnek/HP/gozer/designate/designate/cmd/manage.py", line 110, in main
        utils.read_config('designate', sys.argv)
      File "/home/macinnek/HP/gozer/designate/designate/utils.py", line 96, in read_config
        default_config_files=config_files)
      File "/home/macinnek/HP/gozer/designate/.tox/py27/local/lib/python2.7/site-packages/oslo_config/cfg.py", line 1958, in __call__
        else sys.argv[1:])
      File "/home/macinnek/HP/gozer/designate/.tox/py27/local/lib/python2.7/site-packages/oslo_config/cfg.py", line 2537, in _parse_cli_opts
        opt._add_to_cli(self._oparser, group)
      File "/home/macinnek/HP/gozer/designate/.tox/py27/local/lib/python2.7/site-packages/oslo_config/cfg.py", line 1273, in _add_to_cli
        self.handler(subparsers)
      File "/home/macinnek/HP/gozer/designate/designate/cmd/manage.py", line 56, in add_command_parsers
        command_object = cls()
      File "/home/macinnek/HP/gozer/designate/designate/manage/base.py", line 42, in __init__
        policy.init()
      File "/home/macinnek/HP/gozer/designate/designate/policy.py", line 70, in init
        raise exceptions.ConfigurationError(msg)
    designate.exceptions.ConfigurationError: Unable to determine appropriate policy json file

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to designate (master)

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

Changed in designate:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to designate (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/249213

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to designate (master)

Reviewed: https://review.openstack.org/249202
Committed: https://git.openstack.org/cgit/openstack/designate/commit/?id=52500ae2e4a6a45986018f4158c68a3287d04cfe
Submitter: Jenkins
Branch: master

commit 52500ae2e4a6a45986018f4158c68a3287d04cfe
Author: Kiall Mac Innes <email address hidden>
Date: Tue Nov 24 13:21:53 2015 +0000

    Ensure designate-manage reads config before policy

    With the designate-manage command, the policy file is read before
    the configuration is parsed.

    If the policy file is in a non-default location, all designate-manage
    commands would fail.

    Change-Id: Ic1e37c18cc61732db8df0d59cdb687b0167d63c0
    Closes-Bug: 1519356

Changed in designate:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to designate (stable/liberty)

Reviewed: https://review.openstack.org/249213
Committed: https://git.openstack.org/cgit/openstack/designate/commit/?id=f7c3ed7aead4a6bf28d2cbffc812d11768511d46
Submitter: Jenkins
Branch: stable/liberty

commit f7c3ed7aead4a6bf28d2cbffc812d11768511d46
Author: Kiall Mac Innes <email address hidden>
Date: Tue Nov 24 13:21:53 2015 +0000

    Ensure designate-manage reads config before policy

    With the designate-manage command, the policy file is read before
    the configuration is parsed.

    If the policy file is in a non-default location, all designate-manage
    commands would fail.

    Change-Id: Ic1e37c18cc61732db8df0d59cdb687b0167d63c0
    Closes-Bug: 1519356

Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/designate 2.0.0.0b1

This issue was fixed in the openstack/designate 2.0.0.0b1 development milestone.

Changed in designate:
status: Fix Committed → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/designate 1.0.1

This issue was fixed in the openstack/designate 1.0.1 release.

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.