policy classes parameters documentation incorrect

Bug #1409897 reported by Mike Dorman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
puppet-glance
Fix Released
Low
Mike Dorman
puppet-neutron
Fix Released
Low
Mike Dorman
puppet-nova
Fix Released
Low
Mike Dorman

Bug Description

Policy configuration through ::nova::policy (and similarly for the other services' modules) does not work if you use the $policies parameter format as is documented in the comments.

The comments on the ::nova::policy class indicate that the policies hash should be in this format:

{
  'nova-context_is_admin' => {
    'context_is_admin' => 'true'
  },
  'nova-default' => {
    'default' => 'rule:admin_or_owner'
  }
}

... which is given directly to create_resources.

However, in order for this to work properly, the hash given to create_resources should look like:

{
  'nova-context_is_admin' => {
    'key' => 'context_is_admin',
    'value' => 'true'
  },
  'nova-default' => {
    'key' => 'default',
    'value' => 'rule:admin_or_owner'
  }
}

If the user is providing a hash to ::nova::policy of the correct format, then all will be well. But if the user is providing a format as indicated in the comments, then the Puppet run will fail with:

Error: Invalid parameter context_is_admin on Openstacklib::Policy::Base[nova-context_is_admin] on node xxxxx

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

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

Changed in puppet-nova:
assignee: nobody → Mike Dorman (mdorman-m)
status: New → In Progress
Changed in puppet-neutron:
assignee: nobody → Mike Dorman (mdorman-m)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-neutron (master)

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

Changed in puppet-glance:
assignee: nobody → Mike Dorman (mdorman-m)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-glance (master)

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

Mike Dorman (mdorman-m)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on puppet-nova (master)

Change abandoned by Mike Dorman (<email address hidden>) on branch: master
Review: https://review.openstack.org/146635
Reason: Going after the wrong problem here. See updated bug report.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on puppet-neutron (master)

Change abandoned by Mike Dorman (<email address hidden>) on branch: master
Review: https://review.openstack.org/146637
Reason: Going after the wrong problem here. See updated bug report.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on puppet-glance (master)

Change abandoned by Mike Dorman (<email address hidden>) on branch: master
Review: https://review.openstack.org/146638
Reason: Going after the wrong problem here. See updated bug report.

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

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

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

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

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

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

Mike Dorman (mdorman-m)
summary: - policy configuration does not work with Puppet future parser
+ policy classes parameters documentation incorrect
description: updated
Changed in puppet-glance:
importance: Undecided → Low
Changed in puppet-neutron:
importance: Undecided → Low
Changed in puppet-nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-nova (master)

Reviewed: https://review.openstack.org/146660
Committed: https://git.openstack.org/cgit/stackforge/puppet-nova/commit/?id=96b96f33939862543e62695b1dff14b80d893c33
Submitter: Jenkins
Branch: master

commit 96b96f33939862543e62695b1dff14b80d893c33
Author: Mike Dorman <email address hidden>
Date: Mon Jan 12 15:22:06 2015 -0700

    Correct docs on format for nova::policy data

    Correct the format of the $policies parameter to nova::policy.
    That parameter is passed directly to create_resources, so it needs
    to be in a format acceptable to that.

    Just updating docs here as anyone already using the policy classes
    are likely not using the (incorrectly) documented format, anyway.

    Change-Id: I774678f0b49ee05b6aee6a5565302377d8eae186
    Closes-bug: 1409897

Changed in puppet-nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-glance (master)

Reviewed: https://review.openstack.org/146662
Committed: https://git.openstack.org/cgit/stackforge/puppet-glance/commit/?id=ad5bb3d76b98b847bac5ed2467a46173343a1264
Submitter: Jenkins
Branch: master

commit ad5bb3d76b98b847bac5ed2467a46173343a1264
Author: Mike Dorman <email address hidden>
Date: Mon Jan 12 15:27:20 2015 -0700

    Correct docs on format for glance::policy data

    Correct the format of the $policies parameter to glance::policy.
    That parameter is passed directly to create_resources, so it needs
    to be in a format acceptable to that.

    Just updating docs here as anyone already using the policy classes
    are likely not using the (incorrectly) documented format, anyway.

    Change-Id: I80f1f832db124eef3bfd75907e4a2dcb5a5effca
    Closes-bug: 1409897

Changed in puppet-glance:
status: In Progress → Fix Committed
Changed in puppet-neutron:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-neutron (master)

Reviewed: https://review.openstack.org/146664
Committed: https://git.openstack.org/cgit/stackforge/puppet-neutron/commit/?id=6d2aa10d8f8ed2dc05ee300e067e431d02d2209e
Submitter: Jenkins
Branch: master

commit 6d2aa10d8f8ed2dc05ee300e067e431d02d2209e
Author: Mike Dorman <email address hidden>
Date: Mon Jan 12 15:27:50 2015 -0700

    Correct docs on format for neutron::policy data

    Correct the format of the $policies parameter to neutron::policy.
    That parameter is passed directly to create_resources, so it needs
    to be in a format acceptable to that.

    Just updating docs here as anyone already using the policy classes
    are likely not using the (incorrectly) documented format, anyway.

    Change-Id: Ib69e2e421b216d6087ad47c198067667db89cc33
    Closes-bug: 1409897

Mathieu Gagné (mgagne)
Changed in puppet-glance:
milestone: none → 6.0.0
Changed in puppet-neutron:
milestone: none → 6.0.0
Changed in puppet-nova:
milestone: none → 6.0.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-glance (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/187320

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-neutron (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/187383

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-nova (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/187398

Matt Fischer (mfisch)
Changed in puppet-glance:
status: Fix Committed → Fix Released
Changed in puppet-neutron:
status: Fix Committed → Fix Released
Changed in puppet-nova:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-glance (stable/juno)

Reviewed: https://review.openstack.org/187320
Committed: https://git.openstack.org/cgit/stackforge/puppet-glance/commit/?id=a1468e4c735a98288dbdbe6c0fd2eae8a132fc1a
Submitter: Jenkins
Branch: stable/juno

commit a1468e4c735a98288dbdbe6c0fd2eae8a132fc1a
Author: Mike Dorman <email address hidden>
Date: Mon Jan 12 15:27:20 2015 -0700

    Correct docs on format for glance::policy data

    Correct the format of the $policies parameter to glance::policy.
    That parameter is passed directly to create_resources, so it needs
    to be in a format acceptable to that.

    Just updating docs here as anyone already using the policy classes
    are likely not using the (incorrectly) documented format, anyway.

    Change-Id: I80f1f832db124eef3bfd75907e4a2dcb5a5effca
    Closes-bug: 1409897
    (cherry picked from commit ad5bb3d76b98b847bac5ed2467a46173343a1264)

tags: added: in-stable-juno
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-neutron (stable/juno)

Reviewed: https://review.openstack.org/187383
Committed: https://git.openstack.org/cgit/stackforge/puppet-neutron/commit/?id=a994da94d7ff55b4cafbb559643221a51b4e8e9e
Submitter: Jenkins
Branch: stable/juno

commit a994da94d7ff55b4cafbb559643221a51b4e8e9e
Author: Mike Dorman <email address hidden>
Date: Mon Jan 12 15:27:50 2015 -0700

    Correct docs on format for neutron::policy data

    Correct the format of the $policies parameter to neutron::policy.
    That parameter is passed directly to create_resources, so it needs
    to be in a format acceptable to that.

    Just updating docs here as anyone already using the policy classes
    are likely not using the (incorrectly) documented format, anyway.

    Change-Id: Ib69e2e421b216d6087ad47c198067667db89cc33
    Closes-bug: 1409897
    (cherry picked from commit 6d2aa10d8f8ed2dc05ee300e067e431d02d2209e)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-nova (stable/juno)

Reviewed: https://review.openstack.org/187398
Committed: https://git.openstack.org/cgit/stackforge/puppet-nova/commit/?id=bec17f1f9482cb1f551159319d36edf5f81164d9
Submitter: Jenkins
Branch: stable/juno

commit bec17f1f9482cb1f551159319d36edf5f81164d9
Author: Mike Dorman <email address hidden>
Date: Mon Jan 12 15:22:06 2015 -0700

    Correct docs on format for nova::policy data

    Correct the format of the $policies parameter to nova::policy.
    That parameter is passed directly to create_resources, so it needs
    to be in a format acceptable to that.

    Just updating docs here as anyone already using the policy classes
    are likely not using the (incorrectly) documented format, anyway.

    Change-Id: I774678f0b49ee05b6aee6a5565302377d8eae186
    Closes-bug: 1409897
    (cherry picked from commit 96b96f33939862543e62695b1dff14b80d893c33)

Mathieu Gagné (mgagne)
Changed in puppet-glance:
status: Fix Released → Fix Committed
Changed in puppet-neutron:
status: Fix Released → Fix Committed
Changed in puppet-nova:
status: Fix Released → Fix Committed
Mathieu Gagné (mgagne)
Changed in puppet-glance:
status: Fix Committed → Fix Released
Changed in puppet-nova:
status: Fix Committed → Fix Released
Mathieu Gagné (mgagne)
Changed in puppet-neutron:
status: Fix Committed → Fix Released
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.