2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-15 12:17:44 +00:00

Add license status

Also provide explanation for inactive
licenses.

Change-Id: Iaf11bad639973ac577c724683e6a4166b7f265fb
This commit is contained in:
Jarrod Johnson 2019-06-21 09:29:08 -04:00
parent 79830da7d1
commit ae0cc2d516
2 changed files with 6 additions and 2 deletions

View File

@ -1796,7 +1796,9 @@ class XCCClient(IMMClient):
licdata = self.wc.grab_json_response('/api/providers/imm_fod')
for lic in licdata.get('items', [{}])[0].get('keys', []):
if lic['status'] == 0:
yield {'name': lic['feature']}
yield {'name': lic['feature'], 'state': 'Active'}
elif lic['status'] == 10:
yield {'name': lic['feature'], 'state': 'Missing required license'}
def save_licenses(self, directory):
licdata = self.wc.grab_json_response('/api/providers/imm_fod')

View File

@ -708,7 +708,9 @@ class OEMHandler(generic.OEMHandler):
licdata = self.wc.grab_json_response('/api/providers/imm_fod')
for lic in licdata.get('items', [{}])[0].get('keys', []):
if lic['status'] == 0:
yield {'name': lic['feature']}
yield {'name': lic['feature'], 'state': 'Active'}
if lic['status'] == 10:
yield {'name': lic['feature'], 'state': 'Missing required license'}
def delete_license(self, name):
licdata = self.wc.grab_json_response('/api/providers/imm_fod')