summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kraft <george.kraft@calxeda.com>2013-11-05 17:03:44 -0600
committerGeorge Kraft <george.kraft@calxeda.com>2013-11-05 17:03:44 -0600
commitbdf6908cdaa2e2820d46511a6f3cd7e471d672f1 (patch)
treece17480cd10b280ae986094717fe7e940fe7fe7f
parent72054da9858a6466eb8f38a0c339bbbb9943114c (diff)
downloadpyipmi-bdf6908cdaa2e2820d46511a6f3cd7e471d672f1.tar.gz
CXMAN-231: Add bindings for the PMIC get version command
-rw-r--r--pyipmi/bmc.py4
-rw-r--r--pyipmi/commands/__init__.py2
-rw-r--r--pyipmi/commands/pmic.py50
3 files changed, 56 insertions, 0 deletions
diff --git a/pyipmi/bmc.py b/pyipmi/bmc.py
index f7f2222..d84e842 100644
--- a/pyipmi/bmc.py
+++ b/pyipmi/bmc.py
@@ -580,6 +580,10 @@ class BMC(object):
return self.handle.fabric_info_getdepthchart(filename=filename,
tftp_addr=tftp_addr)
+ def pmic_get_version(self):
+ return self.handle.pmic_get_version()
+
+
class LanBMC(BMC):
"""A BMC that's accessed over the LAN"""
def __init__(self,
diff --git a/pyipmi/commands/__init__.py b/pyipmi/commands/__init__.py
index 380aaf6..0ec7cbd 100644
--- a/pyipmi/commands/__init__.py
+++ b/pyipmi/commands/__init__.py
@@ -60,6 +60,7 @@ from bootparam import bootparam_commands
from mc import mc_commands
from data import data_commands
from info import info_commands
+from pmic import pmic_commands
ipmi_commands = {}
@@ -87,3 +88,4 @@ ipmi_commands.update(bootparam_commands)
ipmi_commands.update(mc_commands)
ipmi_commands.update(data_commands)
ipmi_commands.update(info_commands)
+ipmi_commands.update(pmic_commands)
diff --git a/pyipmi/commands/pmic.py b/pyipmi/commands/pmic.py
new file mode 100644
index 0000000..6163e35
--- /dev/null
+++ b/pyipmi/commands/pmic.py
@@ -0,0 +1,50 @@
+# Copyright (c) 2012, Calxeda Inc.
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Calxeda Inc. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+# DAMAGE.
+
+
+from .. import Command
+from pyipmi.info import *
+from pyipmi.tools.responseparser import ResponseParserMixIn
+from pyipmi import IpmiError
+
+
+class PMICGetVersionCommand(Command):
+ """ Describes the pmic get version command """
+ result_type = str
+ ipmitool_args = ['cxoem', 'pmic', 'get', 'version']
+
+ def parse_results(self, out, err):
+ """ Parse the command response """
+ return out.partition(":")[2].strip()
+
+
+pmic_commands = {
+ "pmic_get_version": PMICGetVersionCommand
+}