fix for ceph ephemeral condition

Change-Id: I3802516e16529e941bf9bed848f692c55257ff32
Closes-Bug: #1585357
diff --git a/nova/files/juno/nova-compute.conf.Debian b/nova/files/juno/nova-compute.conf.Debian
index ebb3c5a..bb4dba5 100644
--- a/nova/files/juno/nova-compute.conf.Debian
+++ b/nova/files/juno/nova-compute.conf.Debian
@@ -22,7 +22,7 @@
 reserved_host_memory_mb = {{ compute.reserved_host_memory_mb }}
 {%- endif %}
 
-{%- if compute.ceph.ephemeral is defined %}
+{%- if compute.get('ceph', {}).ephemeral is defined %}
 live_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST,VIR_MIGRATE_TUNNELLED"
 {%- else %}
 live_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE
@@ -132,7 +132,7 @@
 auth_protocol=http
 auth_uri=http://{{ compute.identity.host }}:5000
 
-{%- if compute.ceph.ephemeral is defined %}
+{%- if compute.get('ceph', {}).ephemeral is defined %}
 [libvirt]
 images_type=rbd
 images_rbd_pool={{ compute.ceph.rbd_pool }}
diff --git a/nova/files/kilo/nova-compute.conf.Debian b/nova/files/kilo/nova-compute.conf.Debian
index 0b42c74..4f19730 100644
--- a/nova/files/kilo/nova-compute.conf.Debian
+++ b/nova/files/kilo/nova-compute.conf.Debian
@@ -29,7 +29,7 @@
 
 allow_resize_to_same_host=True
 
-{%- if compute.ceph.ephemeral is defined %}
+{%- if compute.get('ceph', {}).ephemeral is defined %}
 live_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST,VIR_MIGRATE_TUNNELLED"
 {%- else %}
 live_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE
@@ -178,7 +178,7 @@
 os_region_name = {{ compute.identity.region }}
 catalog_info=volumev2:cinderv2:internalURL
 
-{%- if compute.ceph.ephemeral is defined %}
+{%- if compute.get('ceph', {}).ephemeral is defined %}
 [libvirt]
 images_type=rbd
 images_rbd_pool={{ compute.ceph.rbd_pool }}
diff --git a/nova/files/liberty/nova-compute.conf.Debian b/nova/files/liberty/nova-compute.conf.Debian
index cf90e6f..5f36af6 100644
--- a/nova/files/liberty/nova-compute.conf.Debian
+++ b/nova/files/liberty/nova-compute.conf.Debian
@@ -27,7 +27,7 @@
 
 allow_resize_to_same_host=True
 
-{%- if compute.ceph.ephemeral is defined %}
+{%- if compute.get('ceph', {}).ephemeral is defined %}
 live_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST,VIR_MIGRATE_TUNNELLED"
 {%- else %}
 live_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE
@@ -176,7 +176,7 @@
 os_region_name = {{ compute.identity.region }}
 catalog_info=volumev2:cinderv2:internalURL
 
-{%- if compute.ceph.ephemeral is defined %}
+{%- if compute.get('ceph', {}).ephemeral is defined %}
 [libvirt]
 images_type=rbd
 images_rbd_pool={{ compute.ceph.rbd_pool }}
diff --git a/nova/files/mitaka/nova-compute.conf.Debian b/nova/files/mitaka/nova-compute.conf.Debian
index 245daf4..a4cd639 100644
--- a/nova/files/mitaka/nova-compute.conf.Debian
+++ b/nova/files/mitaka/nova-compute.conf.Debian
@@ -26,7 +26,7 @@
 
 allow_resize_to_same_host=True
 
-{%- if compute.ceph.ephemeral is defined %}
+{%- if compute.get('ceph', {}).ephemeral is defined %}
 live_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST,VIR_MIGRATE_TUNNELLED"
 {%- else %}
 live_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE
@@ -151,7 +151,7 @@
 os_region_name = {{ compute.identity.region }}
 catalog_info=volumev2:cinderv2:internalURL
 
-{%- if compute.ceph.ephemeral is defined %}
+{%- if compute.get('ceph', {}).ephemeral is defined %}
 [libvirt]
 images_type=rbd
 images_rbd_pool={{ compute.ceph.rbd_pool }}