2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 17:43:14 +00:00

Merge pull request #58 from zhougj4/master

[merge-LXCA] Add support for graphical consoles
This commit is contained in:
Jarrod Johnson 2021-05-12 07:31:50 -04:00 committed by GitHub
commit 9b7a40a358
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 0 deletions

View File

@ -349,6 +349,10 @@ def _init_core():
'pluginattrs': ['hardwaremanagement.method'],
'default': 'ipmi',
}),
'graphical': PluginRoute({
'pluginattrs': ['hardwaremanagement.method'],
'default': 'ipmi',
}),
},
'description': PluginRoute({
'pluginattrs': ['hardwaremanagement.method'],

View File

@ -1791,6 +1791,19 @@ class License(ConfluentMessage):
else:
self.kvpairs = {name: {'License': kv}}
class GraphicalConsole(ConfluentMessage):
readonly = True
def __init__(self, name=None, mime=None, data=None):
self.notnode = name is None
self.desc = 'Graphical console launcher'
kv = []
kv.append({'mime': mime, 'data': data})
if self.notnode:
self.kvpairs = {'Launcher': kv}
else:
self.kvpairs = {name: {'Launcher': kv}}
class CryptedAttributes(Attributes):
defaulttype = 'password'

View File

@ -580,6 +580,8 @@ class IpmiHandler(object):
self.decode_alert()
elif self.element == ['console', 'license']:
self.handle_license()
elif self.element == ['console', 'graphical']:
self.handle_graphical_console()
elif self.element == ['support', 'servicedata']:
self.handle_servicedata_fetch()
elif self.element == ['description']:
@ -1570,6 +1572,12 @@ class IpmiHandler(object):
dsc = self.ipmicmd.get_description()
self.output.put(msg.KeyValueData(dsc, self.node))
def handle_graphical_console(self):
args = self.ipmicmd.get_graphical_console()
m = msg.GraphicalConsole(self.node, *args)
self.output.put(m)
return
def _str_health(health):
if isinstance(health, str):