From de77c471f3df400c4c7df724c78dbd7dc771c618 Mon Sep 17 00:00:00 2001 From: Adam Gandelman Date: Wed, 11 Mar 2015 17:15:42 -0700 Subject: [PATCH] Make ironic's service check flexible We currently assume we are deploying ironic with the rest of a cloud and assert that glance/neutron/nova are enabled. This makes it a bit more flexible and allows deploying with only the minimum required services if desired, and asserts the others are enabled when we intend on testing nova+ironic integration. This is required for in-tree python-ironicclient functional tests, which we aim to run against a minimal devstack deployment. Change-Id: I99001d151161fa225b97c3ba6b167a61aa9b59fe --- lib/ironic | 6 +++++- lib/nova_plugins/hypervisor-ironic | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/ironic b/lib/ironic index 0d7c12777c..e530f523f2 100644 --- a/lib/ironic +++ b/lib/ironic @@ -180,7 +180,11 @@ function is_deployed_with_ipa_ramdisk { # install_ironic() - Collect source and prepare function install_ironic { # make sure all needed service were enabled - for srv in nova glance key; do + local req_services="mysql rabbit key" + if [[ "$VIRT_DRIVER" == "ironic" ]]; then + req_services+=" nova glance neutron" + fi + for srv in $req_services; do if ! is_service_enabled "$srv"; then die $LINENO "$srv should be enabled for Ironic." fi diff --git a/lib/nova_plugins/hypervisor-ironic b/lib/nova_plugins/hypervisor-ironic index 0169d731e8..b9e286d5b6 100644 --- a/lib/nova_plugins/hypervisor-ironic +++ b/lib/nova_plugins/hypervisor-ironic @@ -54,9 +54,7 @@ function configure_nova_hypervisor { # install_nova_hypervisor() - Install external components function install_nova_hypervisor { - if ! is_service_enabled neutron; then - die $LINENO "Neutron should be enabled for usage of the Ironic Nova driver." - elif is_ironic_hardware; then + if is_ironic_hardware; then return fi install_libvirt