From 0adb6dd1b9233c6cedf528ba272c98ac96ebba51 Mon Sep 17 00:00:00 2001
From: Miles Gould <mgould@redhat.com>
Date: Wed, 25 Jan 2017 18:22:09 +0000
Subject: [PATCH] devstack: install python-dracclient if DRAC enabled

Change-Id: Ic1b132e25c13e0171ac1d5edf109a5412d76e56f
---
 devstack/lib/ironic | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/devstack/lib/ironic b/devstack/lib/ironic
index 9a7b47c3f7..7bf0c07389 100644
--- a/devstack/lib/ironic
+++ b/devstack/lib/ironic
@@ -527,6 +527,11 @@ function is_deployed_by_snmp {
     return 1
 }
 
+function is_drac_enabled {
+    [[ -z "${IRONIC_ENABLED_DRIVERS##*_drac}" ]] && return 0
+    return 1
+}
+
 function is_glance_configuration_required {
     is_deployed_by_agent || [[ "$IRONIC_CONFIGURE_GLANCE_WITH_SWIFT" == "True" ]] && return 0
     return 1
@@ -717,6 +722,10 @@ function install_ironic {
     if is_deployed_by_snmp && [[ "$IRONIC_IS_HARDWARE" == "False" ]]; then
         setup_virtualpdu
     fi
+
+    if is_drac_enabled; then
+        pip_install python-dracclient
+    fi
 }
 
 # install_ironicclient() - Collect sources and prepare