check and delete policy_association_for_region_and_service performs create

Bug #1400362 reported by Adam Young
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
High
Adam Young

Bug Description

In http://git.openstack.org/cgit/openstack/keystone/tree/keystone/contrib/endpoint_policy/controllers.py#n133

.create_policy_association should be check_policy_association

 @controller.protected()
    def check_policy_association_for_region_and_service(
            self, context, policy_id, service_id, region_id):
        """Check an association between a policy and region+service."""
        self.policy_api.get_policy(policy_id)
        self.catalog_api.get_service(service_id)
        self.catalog_api.get_region(region_id)
        self.endpoint_policy_api.create_policy_association(
            policy_id, service_id=service_id, region_id=region_id)

create_policy_association( should be delete_policy_association(

    @controller.protected()
    def delete_policy_association_for_region_and_service(
            self, context, policy_id, service_id, region_id):
        """Delete an association between a policy and region+service."""
        self.policy_api.get_policy(policy_id)
        self.catalog_api.get_service(service_id)
        self.catalog_api.get_region(region_id)
        self.endpoint_policy_api.create_policy_association(
            policy_id, service_id=service_id, region_id=region_id)

Adam Young (ayoung)
Changed in keystone:
assignee: nobody → Henry Nash (henry-nash)
importance: Undecided → High
Revision history for this message
Morgan Fainberg (mdrnstm) wrote :

This also needs a hard look at tests to make sure we're *actually* testing this as well. We obviously are not.

Changed in keystone:
milestone: none → kilo-1
status: New → Triaged
Adam Young (ayoung)
summary: - check and delete policy_association_for_region_and_servce performs
+ check and delete policy_association_for_region_and_service performs
create
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

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

Changed in keystone:
assignee: Henry Nash (henry-nash) → Adam Young (ayoung)
status: Triaged → In Progress
Changed in keystone:
assignee: Adam Young (ayoung) → Morgan Fainberg (mdrnstm)
Changed in keystone:
assignee: Morgan Fainberg (mdrnstm) → Brant Knudson (blk-u)
Brant Knudson (blk-u)
Changed in keystone:
assignee: Brant Knudson (blk-u) → Adam Young (ayoung)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/140122
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=1c615db7f2b3c29d58cfbd03e497a1e4b55cbb78
Submitter: Jenkins
Branch: master

commit 1c615db7f2b3c29d58cfbd03e497a1e4b55cbb78
Author: Adam Young <email address hidden>
Date: Mon Dec 8 14:12:24 2014 -0500

    Check and delete for policy_association_for_region_and_service

    Calls proper function in the manager and driver

    Unit tests now check pre- and post- conditions on CRUD

    Change-Id: I26e4d4f15ff39dd76141aa5fb7aae1ebb6680bf7
    Closes-bug: 1400362

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: kilo-1 → 2015.1.0
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.