From 8e9cd4d278971022a1e34cff351dccfce1a8081b Mon Sep 17 00:00:00 2001
From: msimonin <matthieu.simonin@inria.fr>
Date: Fri, 2 Jun 2017 10:47:25 +0200
Subject: [PATCH] Fix nova fake driver support

Recent code updates[1][2] broke the support for nova fake drivers.
in [1], nova_services dict is introduce but the change is not refected
in nova.conf.j2[3] when dealing with its elements.
in [2], two typos make neutron handlers to fail.

[1]: https://review.openstack.org/#/c/407416/
[2]: https://review.openstack.org/#/c/424504/
[3]:
https://github.com/openstack/kolla-ansible/blob/master/ansible/roles/nova/templates/nova.conf.j2#L35

Change-Id: Ie32c76c4c902f1d95a1b4c97f8cbdb7ab101e48b
Closes-bug: #1695218
---
 ansible/roles/neutron/handlers/main.yml   | 4 ++--
 ansible/roles/nova/templates/nova.conf.j2 | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ansible/roles/neutron/handlers/main.yml b/ansible/roles/neutron/handlers/main.yml
index fddaaccbcc..127a514e3b 100644
--- a/ansible/roles/neutron/handlers/main.yml
+++ b/ansible/roles/neutron/handlers/main.yml
@@ -73,7 +73,7 @@
   with_sequence: "start=1 end={{ num_nova_fake_per_node }}"
   when:
     - action != "config"
-    - enabled_nova_fake | bool
+    - enable_nova_fake | bool
     - neutron_plugin_agent == "openvswitch"
     - inventory_hostname in groups["compute"]
     - fake_config_json | changed
@@ -100,7 +100,7 @@
   with_sequence: "start=1 end={{ num_nova_fake_per_node }}"
   when:
     - action != "config"
-    - enabled_nova_fake | bool
+    - enable_nova_fake | bool
     - neutron_plugin_agent == "sfc"
     - inventory_hostname in groups["compute"]
     - fake_config_json | changed
diff --git a/ansible/roles/nova/templates/nova.conf.j2 b/ansible/roles/nova/templates/nova.conf.j2
index 606d7218cd..c54f8fcbc1 100644
--- a/ansible/roles/nova/templates/nova.conf.j2
+++ b/ansible/roles/nova/templates/nova.conf.j2
@@ -32,7 +32,7 @@ scheduler_default_filters = RetryFilter,AvailabilityZoneFilter,ComputeFilter,Com
 {% if orchestration_engine == 'KUBERNETES' %}
 host = empty
 {% else %}
-host = {{ ansible_hostname }}_{{ item }}
+host = {{ ansible_hostname }}_{{ service_name }}
 {% endif %}
 compute_driver = fake.FakeDriver
 {% else %}
-- 
GitLab