From 0ae2b7acc65d596e112b272e92885f2a8cb16987 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 28 Sep 2015 11:20:44 -0400 Subject: [PATCH] Move 'leds' to be a hardware sensor category Rather than 'led' being distinct from 'hardware', have 'leds' be a category of 'hardware' like 'fans' or other things similarly hardware related. --- confluent_server/confluent/core.py | 7 +++---- .../confluent/plugins/hardwaremanagement/ipmi.py | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/confluent_server/confluent/core.py b/confluent_server/confluent/core.py index 1bb86441..4e9b1c53 100644 --- a/confluent_server/confluent/core.py +++ b/confluent_server/confluent/core.py @@ -214,13 +214,12 @@ noderesources = { 'pluginattrs': ['hardwaremanagement.method'], 'default': 'ipmi', }), - }, - 'led': { - 'all': PluginCollection({ + 'leds': PluginCollection({ 'pluginattrs': ['hardwaremanagement.method'], 'default': 'ipmi', - }) + }), }, + }, } diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index cd739759..a6de51b5 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -646,12 +646,12 @@ class IpmiHandler(object): self.sensorcategory = self.element[2] # list sensors per category if len(self.element) == 3 and self.element[-2] == 'hardware': + if self.sensorcategory == 'leds': + return self.list_leds() return self.list_sensors() - elif len(self.element) == 3 and self.element[-2] == 'led': - return self.list_leds() - elif len(self.element) == 4 and self.element[1] == 'led': - return self.read_leds(self.element[-1]) elif len(self.element) == 4: # resource requested + if self.sensorcategory == 'leds': + return self.read_leds(self.element[-1]) return self.read_sensors(self.element[-1]) def match_sensor(self, sensor):