"keystone-manage mapping_purge" ignores --type option

Bug #1757022 reported by Dai Hanada
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Undecided
Lance Bragstad

Bug Description

Description
===========
Although I executed "keystone-manage mapping_purge --type user", not only user entities but also group entities were purged.
It seems that "--type" option was ignored.

Steps to reproduce
==================
1. "id_mapping" table of keystone db has a user and a group entity.

  MariaDB [keystone]> select * from id_mapping;
  +------------------------------------------------------------------+----------------------------------+-----------+-------------+
  | public_id | domain_id | local_id | entity_type |
  +------------------------------------------------------------------+----------------------------------+-----------+-------------+
  | a8fdd84b61106a6429908fab68e989751edaca9f84f7413b6d6598426c703b15 | d06cf4dec767422580c7ff24c6526b8f | demo | user | <-- user
  | 9525834b497a7ebac4fa8d6cb19c6c1f2b784540f8914a7abd1404642587a8e3 | d06cf4dec767422580c7ff24c6526b8f | testgroup | group | <-- group
  +------------------------------------------------------------------+----------------------------------+-----------+-------------+

2. Execute "keystone-manage mapping_purge" with "--type user" option.

  # keystone-manage mapping_purge --type user

3. Both of the user and the group entity were purged.

  MariaDB [keystone]> select * from id_mapping;
  Empty set (0.00 sec) <-- The command purged all mappings as same as without options.

Tags: office-hours
Dai Hanada (dai-hanada)
Changed in keystone:
assignee: nobody → Dai Hanada (dai-hanada)
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/554397

Changed in keystone:
status: New → In Progress
Changed in keystone:
assignee: Dai Hanada (dai-hanada) → Masaki Hatada (mas-hatada-deactivatedaccount)
Changed in keystone:
assignee: Masaki Hatada (mas-hatada-deactivatedaccount) → Dai Hanada (dai-hanada)
tags: added: office-hours
Changed in keystone:
assignee: Dai Hanada (dai-hanada) → Lance Bragstad (lbragstad)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/554397
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=74684cf53bffb17af1012af30daf04abfdadc253
Submitter: Zuul
Branch: master

commit 74684cf53bffb17af1012af30daf04abfdadc253
Author: DaiHanada <email address hidden>
Date: Wed Feb 7 14:21:38 2018 +0900

    Fix keystone-manage mapping_purge with --type option

    "keystone-manage mapping_purge" has "--type" option in order to select
    mappings which have to be deleted. However, the option doesn't work
    and all mappings are purged when specifying this option.
    The command passes a value of the option to purge_mappings API with
    a key name "type", but the API expects "entity_type".

    Change-Id: Ib222d70d4cf6bb61847cef049ec1ded5c2ff2c8b
    Closes-Bug: #1757022

Changed in keystone:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/keystone 14.0.0.0rc1

This issue was fixed in the openstack/keystone 14.0.0.0rc1 release candidate.

Changed in keystone:
milestone: none → rocky-3
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.