Merge "Put correct release version into metadata.yaml for plugin_reboot" into stable/mitaka

This commit is contained in:
Jenkins 2016-04-21 14:32:30 +00:00 committed by Gerrit Code Review
commit f2204a804b
2 changed files with 18 additions and 0 deletions

View File

@ -483,6 +483,22 @@ class FuelPluginBuilder(BaseActions):
)['stdout_str']
return packet_name
def fpb_update_release_in_metadata(self, path):
"""Update fuel version and openstack release version
:param path: path to plugin's dir on master node
"""
metadata_path = os.path.join(path, 'metadata.yaml')
output = self.ssh_manager.execute_on_remote(
ip=self.admin_ip, cmd="fuel --fuel-version --json",
jsonify=True)['stdout_json']
fuel_version = [str(output['release'])]
openstack_version = str(output['openstack_version'])
self.change_remote_yaml(metadata_path, ['fuel_version'], fuel_version)
releases = self.get_value_from_remote_yaml(metadata_path, ['releases'])
releases[0]['version'] = openstack_version
self.put_value_to_remote_yaml(metadata_path, ['releases'], releases)
def fpb_validate_plugin(self, path):
"""
Validates plugin for errors

View File

@ -68,6 +68,7 @@ class RebootPlugin(TestBasic):
# create plugin template on the master node
self.show_step(3)
fpb.fpb_create_plugin(source_plugin_path)
fpb.fpb_update_release_in_metadata(source_plugin_path)
# replace plugin tasks with our file
fpb.fpb_replace_plugin_content(
os.path.join(tasks_path, tasks_file),
@ -199,6 +200,7 @@ class RebootPlugin(TestBasic):
self.show_step(3)
# create plugin template on the master node
fpb.fpb_create_plugin(source_plugin_path)
fpb.fpb_update_release_in_metadata(source_plugin_path)
# replace plugin tasks with our file
fpb.fpb_replace_plugin_content(
os.path.join('/tmp/', tasks_file),