From 3e3be62ba46faf7ad82d3ae9d6b820c791f41c35 Mon Sep 17 00:00:00 2001 From: Yichen Wang Date: Wed, 20 Apr 2016 15:41:18 -0700 Subject: [PATCH] Add configs to pass user_data_file 1. Add configs to pass user_data_file; 2. Update dependencies to fix sphinx error; Change-Id: I1b9c1576f4e59e3026e527502a90b3db4b95fb3b --- requirements-dev.txt | 3 ++- test-requirements.txt | 3 ++- vmtp/cfg.default.yaml | 4 ++++ vmtp/vmtp.py | 5 ++++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index dacaa14..b2f3353 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,5 +3,6 @@ flake8>=2.3.0 git-review>=1.24 pylint>=1.3 pep8>=1.5.7 -sphinx>=1.2.3 +sphinx>=1.4.0 +sphinx_rtd_theme>=0.1.9 tox>=1.9.0 diff --git a/test-requirements.txt b/test-requirements.txt index a252776..8ae84af 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,7 +7,8 @@ hacking<0.11,>=0.10.0 coverage>=3.6 discover python-subunit>=0.0.18 -sphinx>=1.3.1 +sphinx>=1.4.0 +sphinx_rtd_theme>=0.1.9 oslosphinx>=2.5.0 # Apache-2.0 oslotest>=1.10.0 # Apache-2.0 testrepository>=0.0.18 diff --git a/vmtp/cfg.default.yaml b/vmtp/cfg.default.yaml index 68f1ec4..1d106bb 100644 --- a/vmtp/cfg.default.yaml +++ b/vmtp/cfg.default.yaml @@ -74,6 +74,10 @@ reuse_existing_vm: # An option of config_drive to True is provided to nova boot to enable this config_drive: +# The location of the user_data file, which will be passed to every instance +# when booting. +user_data_file: + # ipv6 mode. Set this to one of the following 3 modes # slaac : VM obtains IPV6 address from Openstack radvd using SLAAC # dhcpv6-stateful : VM obtains ipv6 address from dnsmasq using DHCPv6 stateful diff --git a/vmtp/vmtp.py b/vmtp/vmtp.py index bfe8ef2..ac28ee7 100755 --- a/vmtp/vmtp.py +++ b/vmtp/vmtp.py @@ -153,13 +153,16 @@ class VmtpTest(object): # Create an instance on a particular availability zone def create_instance(self, inst, az, int_net): + fn = self.config.user_data_file + user_data_file = fn if fn and os.path.isfile(fn) else None self.assert_true(inst.create(self.image_instance, self.flavor_type, self.instance_access, int_net, az, int_net['name'], - self.sec_group)) + self.sec_group, + init_file_name=user_data_file)) def assert_true(self, cond): if not cond: