diff options
author | Jayanth Othayoth <ojayanth@in.ibm.com> | 2017-04-18 06:13:34 -0500 |
---|---|---|
committer | Jayanth Othayoth <ojayanth@in.ibm.com> | 2017-04-19 01:34:12 -0500 |
commit | 0a3eeb8f2728294ccae8ea0f20b31d643ee93a4e (patch) | |
tree | 42b81ccffbd51ad78231450b4450f3b2859ad3e2 | |
parent | 857e4b834f4bcece8d1006a1fbaef7c2847681d4 (diff) | |
download | pyphosphor-0a3eeb8f2728294ccae8ea0f20b31d643ee93a4e.tar.gz pyphosphor-0a3eeb8f2728294ccae8ea0f20b31d643ee93a4e.zip |
Disable user updates for Power Cap Sensor
Resolves openbmc/openbmc#1421
Change-Id: Id956ea27f5e212928b9698c11180d1945e3350c3
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
-rw-r--r-- | obmc/sensors.py | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/obmc/sensors.py b/obmc/sensors.py index 715ecd0..f34c711 100644 --- a/obmc/sensors.py +++ b/obmc/sensors.py @@ -199,22 +199,12 @@ class PowerCap(VirtualSensor): def __init__(self, bus, name): VirtualSensor.__init__(self, bus, name) SensorValue.setValue(self, 0) - self.sysfs_attr = "/sys/class/hwmon/hwmon3/user_powercap" ##override setValue method @dbus.service.method( SensorValue.IFACE_NAME, in_signature='v', out_signature='') def setValue(self, value): - try: - cmd_str = "echo "+str(value)+" > "+self.sysfs_attr - ret = subprocess.check_output(cmd_str, shell=True) - except subprocess.CalledProcessError as powerexc: - print "Set PowerCap Error", powerexc.returncode, - powerexc.output - return - print "Set PowerCap: ", value - SensorValue.setValue(self, value) - + raise Exception("ERROR: Setting Power Cap is not allowed") class BootProgressSensor(VirtualSensor): def __init__(self, bus, name): |