GENI-NSF / geni-ch

GENI clearinghouse services
Other
3 stars 6 forks source link

lookup and lookup_for_member disagree on the spelling of EXPIRED #537

Closed nbastin closed 7 years ago

nbastin commented 7 years ago

If you call lookup for projects, they come back with a PROJECT_EXPIRED key, and not an EXPIRED key. However, the results from lookup_for_member on projects return an EXPIRED key, and no PROJECT_EXPIRED key. This makes it hard to be agnostic about what calls project data comes from.

Sample entry from lookup_for_member:

 {'EXPIRED': False,
  'PROJECT_ROLE': 'LEAD',
  'PROJECT_UID': '10c88fc8-9d57-4971-8820-5b14323557f5',
  'PROJECT_URN': 'urn:publicid:IDN+ch.geni.net+project+vts-infra'},

Sample entry from lookup:

 'value': {'urn:publicid:IDN+ch.geni.net+project+vts-infra': {'PROJECT_CREATION': '2014-03-07T13:58:17Z',
                                                              'PROJECT_DESCRIPTION': 'Infrastructure for VTS',
                                                              'PROJECT_EXPIRATION': None,
                                                              'PROJECT_EXPIRED': False,
                                                              'PROJECT_NAME': 'vts-infra',
                                                              'PROJECT_UID': '10c88fc8-9d57-4971-8820-5b14323557f5',
                                                              'PROJECT_URN': 'urn:publicid:IDN+ch.geni.net+project+vts-infra',
                                                              '_GENI_PROJECT_EMAIL': None,
                                                              '_GENI_PROJECT_OWNER': '8a447f06-8bd5-4f32-8fd6-1a3528e7fa37'}}}
tcmitchell commented 7 years ago

After reading the code, the same appears to be true for slices. lookup would use SLICE_EXPIRED (from SA_constants.py) and lookup_for_member would use EXPIRED (hardcoded in SAv1PersistentImplementation.py).

tcmitchell commented 7 years ago

I've added SLICE_EXPIRED or PROJECT_EXPIRED to the offending functions.

I left EXPIRED in as well for backward compatibility with a comment explaining that it is there for backward compatibility because of omni. I hope someday the backward compatibility can be removed.