From 57e8186d30977a09cb13755bcdc4fcef0ee3b2e7 Mon Sep 17 00:00:00 2001
From: Nisha Agarwal <agarwalnisha1980@gmail.com>
Date: Tue, 13 Jun 2017 16:51:19 +0000
Subject: [PATCH] py3.5:Workaround fix for forcing virtualbmc installation with
 pip2

The IPMI commands fail for virtualbmc. This is a workaround
fix to enforce virtualbmc to be installed in python2 as
pyghmi is not ready for python3.5 yet.

Related-Bug: 1696736

Change-Id: Ie4ca923ef0b8363d2f016ebc5be4b2512d3b9a1a
---
 devstack/lib/ironic | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/devstack/lib/ironic b/devstack/lib/ironic
index be02c56bc2..1baadd5f84 100644
--- a/devstack/lib/ironic
+++ b/devstack/lib/ironic
@@ -661,7 +661,10 @@ function setup_virtualbmc {
         git_clone_by_name "virtualbmc"
         setup_dev_lib "virtualbmc"
     else
-        pip_install_gr "virtualbmc"
+        # pyghmi is still not compatible with python3
+        # hence we need to install virtualbmc in python2
+        # environment else IPMI calls will fail at the gate.
+        USE_PYTHON3=False pip_install_gr "virtualbmc"
     fi
 
     if [[ ! -d $(dirname $IRONIC_VBMC_CONFIG_FILE) ]]; then