← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1429566] [NEW] misused region / region_id in EP

 

Public bug reported:

Checked from the current IMPL in EP, 'region_id' has the same meaning with 'region', and region with the context actaully means 'region_id'.
https://github.com/openstack/keystone/blob/master/keystone/catalog/backends/sql.py#L333
endpoint['region'] = endpoint['region_id']

But, region and region_id is not used in a consistent way, for example,
Table definition,  region_id is used,
https://github.com/openstack/keystone/blob/master/keystone/catalog/backends/sql.py#L76

Upgrade or downgrade scripts, region is used,
https://github.com/openstack/keystone/blob/master/keystone/common/sql/migrate_repo/versions/042_endpoint_enabled.py#L126

EP in the catalog when using SQL as the backend, both region and region_id are presented in the catalog, this seems is not necessary.
https://github.com/openstack/keystone/blob/master/keystone/catalog/backends/sql.py#L333

while using the template as the backend, only region is presented in the catalog,
https://github.com/openstack/keystone/blob/master/keystone/catalog/core.py#L487

some code cleanup will help to give a consistent way to use region or
region_id.

** Affects: keystone
     Importance: Undecided
     Assignee: Dave Chen (wei-d-chen)
         Status: New

** Changed in: keystone
     Assignee: (unassigned) => Dave Chen (wei-d-chen)

** Description changed:

- Checked from the current IMPL in EP, 'region_id' has the same meaning with region, and region with the context is actaully mean 'region_id'.
+ Checked from the current IMPL in EP, 'region_id' has the same meaning with 'region', and region with the context actaully means 'region_id'.
  https://github.com/openstack/keystone/blob/master/keystone/catalog/backends/sql.py#L333
  endpoint['region'] = endpoint['region_id']
  
  But, region and region_id is not used in a consistent way, for example,
  Table definition,  region_id is used,
  https://github.com/openstack/keystone/blob/master/keystone/catalog/backends/sql.py#L76
  
  Upgrde scripts, region is used,
  https://github.com/openstack/keystone/blob/master/keystone/common/sql/migrate_repo/versions/042_endpoint_enabled.py#L126
  
- 
  EP in the catalog when using SQL as the backend, both region and region_id are presented in the catalog,
  https://github.com/openstack/keystone/blob/master/keystone/catalog/backends/sql.py#L333
  
  while using the template as the backend, only region is presented in the catalog,
  https://github.com/openstack/keystone/blob/master/keystone/catalog/core.py#L487
  
- 
- some code cleanup will help to give a consistent way to use region or region_id.
+ some code cleanup will help to give a consistent way to use region or
+ region_id.

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1429566

Title:
  misused region / region_id in EP

Status in OpenStack Identity (Keystone):
  New

Bug description:
  Checked from the current IMPL in EP, 'region_id' has the same meaning with 'region', and region with the context actaully means 'region_id'.
  https://github.com/openstack/keystone/blob/master/keystone/catalog/backends/sql.py#L333
  endpoint['region'] = endpoint['region_id']

  But, region and region_id is not used in a consistent way, for example,
  Table definition,  region_id is used,
  https://github.com/openstack/keystone/blob/master/keystone/catalog/backends/sql.py#L76

  Upgrade or downgrade scripts, region is used,
  https://github.com/openstack/keystone/blob/master/keystone/common/sql/migrate_repo/versions/042_endpoint_enabled.py#L126

  EP in the catalog when using SQL as the backend, both region and region_id are presented in the catalog, this seems is not necessary.
  https://github.com/openstack/keystone/blob/master/keystone/catalog/backends/sql.py#L333

  while using the template as the backend, only region is presented in the catalog,
  https://github.com/openstack/keystone/blob/master/keystone/catalog/core.py#L487

  some code cleanup will help to give a consistent way to use region or
  region_id.

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1429566/+subscriptions


Follow ups

References