mirror of
https://github.com/xcat2/confluent.git
synced 2025-01-17 21:23:18 +00:00
Implement remote KVM command
This commit is contained in:
parent
fa545eeaee
commit
9b52e276cc
@ -170,6 +170,10 @@ noderesources = {
|
||||
'console': {
|
||||
# this is a dummy value, http or socket must handle special
|
||||
'session': PluginRoute({}),
|
||||
'license': PluginRoute({
|
||||
'pluginattrs': ['hardwaremanagement.method'],
|
||||
'default': 'ipmi',
|
||||
}),
|
||||
},
|
||||
'events': {
|
||||
'hardware': {
|
||||
|
@ -1105,6 +1105,21 @@ class NTPServer(ConfluentMessage):
|
||||
self.kvpairs = {name: kv}
|
||||
|
||||
|
||||
class License(ConfluentMessage):
|
||||
readonly = True
|
||||
|
||||
def __init__(self, name=None, kvm=None):
|
||||
self.notnode = name is None
|
||||
self.desc = 'License'
|
||||
|
||||
kv = []
|
||||
kv.append({'kvm_availability': str(kvm)})
|
||||
if self.notnode:
|
||||
self.kvpairs = {'License': kv}
|
||||
else:
|
||||
self.kvpairs = {name: {'License': kv}}
|
||||
|
||||
|
||||
class CryptedAttributes(Attributes):
|
||||
defaulttype = 'password'
|
||||
|
||||
|
@ -357,6 +357,8 @@ class IpmiHandler(object):
|
||||
self.do_eventlog()
|
||||
elif self.element == ['events', 'hardware', 'decode']:
|
||||
self.decode_alert()
|
||||
elif self.element == ['console', 'license']:
|
||||
self.handle_license()
|
||||
else:
|
||||
raise Exception('Not Implemented')
|
||||
|
||||
@ -819,6 +821,11 @@ class IpmiHandler(object):
|
||||
self.ipmicmd.set_ntp_server(server, idx)
|
||||
return
|
||||
|
||||
def handle_license(self):
|
||||
available = self.ipmicmd.get_remote_kvm_available()
|
||||
self.output.put(msg.License(self.node, available))
|
||||
return
|
||||
|
||||
def _str_health(health):
|
||||
if health == 'unknown':
|
||||
return health
|
||||
|
Loading…
x
Reference in New Issue
Block a user