← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1614154] [NEW] Hints with values of None seem to be broken

 

Public bug reported:

The Hints object allows developers to construct filters to query the
backend for specific entries. For example, I can ask the backend to give
me a list of entities that match a specific criteria:

hints = driver_hints.Hints()
hints.add_filter('key_hash', primary_key_hash)
credentials = self.credential_api.list_credentials(hints)

The above example should give me all credentials that have a key_hash
column matching the value of primary_key_hash. If I try to apply this
same pattern using None as the value to match, I get an error:

http://cdn.pasteraw.com/qv8yl0azk4iu7hwjhkz2ty5c8ti6mb1

It seems that Hints doesn't allow you to filter a backend by "return to
me all things that have this attribute set to NULL", even though we
expect this to work in our code [0].

[0]
https://github.com/openstack/keystone/blob/0b4f6ebdcc866388e1c6788f45f270414b45aeef/keystone/assignment/controllers.py#L437

** Affects: keystone
     Importance: Undecided
         Status: New

** Description changed:

  The Hints object allows developers to construct filters to query the
- backend with. For example, I can ask the backend to give me a list of
- entities that match a specific criteria:
+ backend for specific entries. For example, I can ask the backend to give
+ me a list of entities that match a specific criteria:
  
  hints = driver_hints.Hints()
  hints.add_filter('key_hash', primary_key_hash)
  credentials = self.credential_api.list_credentials(hints)
  
  The above example should give me all credentials that have a key_hash
  column matching the value of primary_key_hash. If I try to apply this
  same pattern using None as the value to match, I get an error:
  
  http://cdn.pasteraw.com/qv8yl0azk4iu7hwjhkz2ty5c8ti6mb1
  
  It seems that Hints doesn't allow you to filter a backend by "return to
  me all things that don't have this attribute set", even though we expect
  this to work in our code [0].
  
  [0]
  https://github.com/openstack/keystone/blob/0b4f6ebdcc866388e1c6788f45f270414b45aeef/keystone/assignment/controllers.py#L437

** Description changed:

  The Hints object allows developers to construct filters to query the
  backend for specific entries. For example, I can ask the backend to give
  me a list of entities that match a specific criteria:
  
  hints = driver_hints.Hints()
  hints.add_filter('key_hash', primary_key_hash)
  credentials = self.credential_api.list_credentials(hints)
  
  The above example should give me all credentials that have a key_hash
  column matching the value of primary_key_hash. If I try to apply this
  same pattern using None as the value to match, I get an error:
  
  http://cdn.pasteraw.com/qv8yl0azk4iu7hwjhkz2ty5c8ti6mb1
  
  It seems that Hints doesn't allow you to filter a backend by "return to
- me all things that don't have this attribute set", even though we expect
- this to work in our code [0].
+ me all things that have this attribute set to NULL", even though we
+ expect this to work in our code [0].
  
  [0]
  https://github.com/openstack/keystone/blob/0b4f6ebdcc866388e1c6788f45f270414b45aeef/keystone/assignment/controllers.py#L437

** Summary changed:

- DriverHints with values of None seem to be broken
+ Hints with values of None seem to be broken

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Identity (keystone).
https://bugs.launchpad.net/bugs/1614154

Title:
  Hints with values of None seem to be broken

Status in OpenStack Identity (keystone):
  New

Bug description:
  The Hints object allows developers to construct filters to query the
  backend for specific entries. For example, I can ask the backend to
  give me a list of entities that match a specific criteria:

  hints = driver_hints.Hints()
  hints.add_filter('key_hash', primary_key_hash)
  credentials = self.credential_api.list_credentials(hints)

  The above example should give me all credentials that have a key_hash
  column matching the value of primary_key_hash. If I try to apply this
  same pattern using None as the value to match, I get an error:

  http://cdn.pasteraw.com/qv8yl0azk4iu7hwjhkz2ty5c8ti6mb1

  It seems that Hints doesn't allow you to filter a backend by "return
  to me all things that have this attribute set to NULL", even though we
  expect this to work in our code [0].

  [0]
  https://github.com/openstack/keystone/blob/0b4f6ebdcc866388e1c6788f45f270414b45aeef/keystone/assignment/controllers.py#L437

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


Follow ups