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:
parent
27410a9b6b
commit
e55314d759
@ -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):
|
||||
|
@ -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:
|
||||
|
@ -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))
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user