summaryrefslogtreecommitdiffstats
path: root/deploy/dha_adapters/ipmi_adapter.py
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2016-05-23 22:06:09 +0200
committerJonas Bjurel <jonas.bjurel@ericsson.com>2016-06-15 08:19:21 +0000
commita2ee8e7efc66be53645c8b1d7c43b7740bc999cd (patch)
treed74cfcd1d6ede33ec2d0da09b5d0dec6851a92ca /deploy/dha_adapters/ipmi_adapter.py
parent8b192597ef66f45a820886bfe2489548a9fa807f (diff)
deploy: ipmi adapter: Add <port> config support.
Sometimes the IPMI lanplus protocol listens on a non-standard remote port, e.g. when target nodes are interfaced through a fake IPMI BMC application that listens on multiple ports on the same IP address. Therefore, allow setting IPMI port in the DHA using a new property named `ipmiPort`, and pass it along to `ipmitool` when set. CHANGE: get_access_info now also supports specifying the IPMI port to use with `ipmitool` by configuring the `ipmiPort` property in the DHA. hp_adapter.py: updated `get_access_info` return signature with the new (unused there) `ipmiport`. Change-Id: I620176bd7f466aa460518cf12d15ccbe86a22560 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'deploy/dha_adapters/ipmi_adapter.py')
-rw-r--r--deploy/dha_adapters/ipmi_adapter.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/deploy/dha_adapters/ipmi_adapter.py b/deploy/dha_adapters/ipmi_adapter.py
index 8fda4f9f0..4bd6bd378 100644
--- a/deploy/dha_adapters/ipmi_adapter.py
+++ b/deploy/dha_adapters/ipmi_adapter.py
@@ -27,12 +27,15 @@ class IpmiAdapter(HardwareAdapter):
ip = self.get_node_property(node_id, 'ipmiIp')
username = self.get_node_property(node_id, 'ipmiUser')
password = self.get_node_property(node_id, 'ipmiPass')
- return ip, username, password
+ ipmiport = self.get_node_property(node_id, 'ipmiPort')
+ return ip, username, password, ipmiport
def ipmi_cmd(self, node_id):
- ip, username, password = self.get_access_info(node_id)
+ ip, username, password, ipmiport = self.get_access_info(node_id)
cmd = 'ipmitool -I lanplus -A password'
cmd += ' -H %s -U %s -P %s' % (ip, username, password)
+ if ipmiport:
+ cmd += ' -p %d' % int(ipmiport)
return cmd
def get_node_pxe_mac(self, node_id):