[identity] create_endpoint and create_service are not idempotent

Bug #1306501 reported by Darren Birkett
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack + Chef
Fix Released
Medium
Kasey Alusi

Bug Description

When calling the create_endpoint function in the register lwrp, it's actions are not idempotent.

If an endpoint for a service exists already, it is not recreated even though the desired endpoint details may be different from the current endpoint details. This is because the check only grabs the uuid of the endpoint and skips if one exists.

The create_endpoint and create_service functions need to actually get the current endpoint details, and compare them to the desired endpoint details, and delete/recreate if different.

Something like this:

https://github.com/rcbops-cookbooks/keystone/blob/master/providers/register.rb#L265-L376

One workaround for this is to use fully qualified host names instead of ip addresses. Then update the /etc/hosts file as needed using the hostfile
cookbook: http://community.opscode.com/cookbooks/hostsfile

Tags: identity
tags: added: identity
Changed in openstack-chef:
importance: Undecided → High
importance: High → Medium
status: New → Confirmed
description: updated
Changed in openstack-chef:
milestone: none → juno-rc1
JJ Asghar (d-jj)
Changed in openstack-chef:
milestone: juno-rc1 → kilo-rc1
Changed in openstack-chef:
assignee: nobody → Kasey Alusi (kasey-alusi)
Revision history for this message
Kasey Alusi (kasey-alusi) wrote :

It seems like the endpoint create does check to see if the values are the same, based on this: https://github.com/stackforge/cookbook-openstack-identity/blob/master/providers/register.rb#L117-L126 Should this bug just be to add that same functionality to the service creation?

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

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

Changed in openstack-chef:
status: Confirmed → In Progress
Revision history for this message
Mark Vanderwiel (vanderwl) wrote :

Kasey, yes I think something along those lines is needed here. Since that example is quite old, not sure if there are other new fields to also include in this diff checking.

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

Reviewed: https://review.openstack.org/177609
Committed: https://git.openstack.org/cgit/stackforge/cookbook-openstack-identity/commit/?id=ce2211c611d64d6645d39f5276491a3b5039fdec
Submitter: Jenkins
Branch: master

commit ce2211c611d64d6645d39f5276491a3b5039fdec
Author: Kasey Alusi <email address hidden>
Date: Sun Apr 26 09:25:32 2015 -0700

    Check whether to recreate service if it exists

        The create_service action only checks to see if a service
        with the same uuid exists, and if it does, it skips. This
        addition checks to see whether a service matches the fields
        and deletes + recreates if fields need to be updated.

        Also included the specs for the ne functionality.

        It looks like the create_endpoint action already does this.
        Used the same process for checking the service.

    Change-Id: I2013877f2f47096324386645f373690f5d9af4f5
    Closes-Bug: #1306501
    Closes-Bug: #1454022

Changed in openstack-chef:
status: In Progress → 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.