2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-12 10:49:17 +00:00

Add display of inactive licenses

Inactive licenses are also an issue.
This commit is contained in:
Jarrod Johnson 2019-06-21 10:17:52 -04:00
parent 27410a9b6b
commit e55314d759
4 changed files with 9 additions and 6 deletions

View File

@ -91,8 +91,11 @@ def show_licenses(session):
'all'.format(noderange)):
for node in res.get('databynode', {}):
for license in res['databynode'][node].get('License', []):
print('{0}: {1}'.format(node, license.get('feature',
'Unknown')))
msg = '{0}: {1}'.format(node, license.get('feature',
'Unknown'))
if license.get('state', 'Active') != 'Active':
msg += ' ({0})'.format(license['state'])
print(msg)
def delete_license(session, licname):

View File

@ -1611,12 +1611,12 @@ class NTPServer(ConfluentMessage):
class License(ConfluentMessage):
readonly = True
def __init__(self, name=None, kvm=None, feature=None):
def __init__(self, name=None, kvm=None, feature=None, state=None):
self.notnode = name is None
self.desc = 'License'
kv = []
kv.append({'kvm_availability': str(kvm), 'feature': feature})
kv.append({'kvm_availability': str(kvm), 'feature': feature, 'state': state})
if self.notnode:
self.kvpairs = {'License': kv}
else:

View File

@ -1463,7 +1463,7 @@ class IpmiHandler(object):
if self.op == 'delete':
self.ipmicmd.delete_license(lic['name'])
else:
self.output.put(msg.License(self.node, feature=lic['name']))
self.output.put(msg.License(self.node, feature=lic['name'], state=lic.get('state', 'Active')))
def handle_description(self):
dsc = self.ipmicmd.get_description()
self.output.put(msg.KeyValueData(dsc, self.node))

View File

@ -1329,7 +1329,7 @@ class IpmiHandler(object):
if self.op == 'delete':
self.ipmicmd.delete_license(lic['name'])
else:
self.output.put(msg.License(self.node, feature=lic['name']))
self.output.put(msg.License(self.node, feature=lic['name'], state=lic.get('state', 'Active')))
def handle_description(self):
dsc = self.ipmicmd.get_description()