2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-28 11:57:37 +00:00

Add support for uploading a license key

This provides the most important piece of license key management.
This commit is contained in:
Jarrod Johnson 2019-01-14 15:09:49 -05:00
parent 3782127590
commit 55c5bff0f9
2 changed files with 8 additions and 0 deletions

View File

@ -438,6 +438,9 @@ def get_input_message(path, operation, inputdata, nodes=None, multinode=False,
return InputMedia(path, nodes, inputdata)
elif '/'.join(path).startswith('support/servicedata') and inputdata:
return InputMedia(path, nodes, inputdata)
elif '/'.join(path).startswith(
'configuration/management_controller/licenses') and inputdata:
return InputLicense(path, nodes, inputdata)
elif inputdata:
raise exc.InvalidArgumentException(
'No known input handler for request')
@ -453,6 +456,9 @@ class InputMedia(InputFirmwareUpdate):
# Use InputFirmwareUpdate
pass
class InputLicense(InputFirmwareUpdate):
pass
class DetachMedia(ConfluentMessage):
def __init__(self, path, nodes, inputdata):

View File

@ -1402,6 +1402,8 @@ class IpmiHandler(object):
def handle_licenses(self):
if self.element[-1] == '':
self.element = self.element[:-1]
if self.op in ('create', 'update'):
self.ipmicmd.apply_license(self.inputdata.filename)
if len(self.element) == 3:
self.output.put(msg.ChildCollection('all'))
i = 1