Merge instances-path for testing

This commit is contained in:
James Page 2014-04-04 17:45:38 +01:00
commit 9f5c6cc83f
8 changed files with 35 additions and 1 deletions

View File

@ -89,6 +89,9 @@ options:
default: eth1
type: string
description: Network interface on which to build bridge
instances-path:
type: string
description: Instance path to use - empty means default of /var/lib/nova/instances
config-flags:
type: string
description: Comma separated list of key=value config flags to be set in nova.conf.

View File

@ -234,6 +234,10 @@ class IdentityServiceContext(OSContextGenerator):
rdata.get('auth_protocol') or 'http',
}
if context_complete(ctxt):
# NOTE(jamespage) this is required for >= icehouse
# so a missing value just indicates keystone needs
# upgrading
ctxt['admin_tenant_id'] = rdata.get('service_tenant_id')
return ctxt
return {}

View File

@ -100,6 +100,9 @@ class NovaComputeLibvirtContext(context.OSContextGenerator):
# nova.conf
ctxt['live_migration_uri'] = 'qemu+ssh://%s/system'
if config('instances-path') is not None:
ctxt['instances_path'] = config('instances-path')
return ctxt

View File

@ -51,7 +51,8 @@ from nova_compute_utils import (
NOVA_CONF,
QUANTUM_CONF, NEUTRON_CONF,
ceph_config_file, CEPH_SECRET,
enable_shell, disable_shell
enable_shell, disable_shell,
fix_path_ownership
)
from nova_compute_context import CEPH_SECRET_UUID
@ -86,6 +87,10 @@ def config_changed():
else:
disable_shell(user='nova')
if config('instances-path') is not None:
fp = config('instances-path')
fix_path_ownership(fp, user='nova')
[compute_joined(rid) for rid in relation_ids('cloud-compute')]
CONFIGS.write_all()

View File

@ -420,3 +420,8 @@ def enable_shell(user):
def disable_shell(user):
cmd = ['usermod', '-s', '/bin/false', user]
check_call(cmd)
def fix_path_ownership(path, user='nova'):
cmd = ['chown', user, path]
check_call(cmd)

View File

@ -75,3 +75,8 @@ volume_api_class = nova.volume.cinder.API
{% if live_migration_uri -%}
live_migration_uri = {{ live_migration_uri }}
{% endif -%}
{% if instances_path -%}
instances_path = {{ instances_path }}
{% endif -%}

View File

@ -79,3 +79,8 @@ volume_api_class = nova.volume.cinder.API
{% if live_migration_uri -%}
live_migration_uri = {{ live_migration_uri }}
{% endif -%}
{% if instances_path -%}
instances_path = {{ instances_path }}
{% endif -%}

View File

@ -80,6 +80,10 @@ volume_api_class = nova.volume.cinder.API
live_migration_uri = {{ live_migration_uri }}
{% endif -%}
{% if instances_path -%}
instances_path = {{ instances_path }}
{% endif -%}
{% if sections and 'DEFAULT' in sections -%}
{% for key, value in sections['DEFAULT'] -%}
{{ key }} = {{ value }}