Fix cfapi test job

After change I17ab2eba0fd6c42309667f42d0644d21940ab02d was merged cfapi
job starts failing. This cause of it is the change in mock_muranopl.yaml
file which is used in tempest tests. Now we remove this change and
update mechanism which added class name by overwrite mock_muranopl.yaml.

Related-Bug: #1604050
Change-Id: I9ab62cd60b25e39f9ec90a85dfa25c80fc3adbad
This commit is contained in:
Nikolay Starodubtsev 2016-07-18 14:28:01 +03:00 committed by Nikolay Starodubtsev
parent e1da1e9a8a
commit 9d97f58fdf
2 changed files with 9 additions and 8 deletions

View File

@ -2,9 +2,6 @@ Namespaces:
=: io.murano.apps
std: io.murano
# Write name into next line
Name: test_repository_class_xxxxxxxx
Extends: std:Application
Properties:

View File

@ -46,11 +46,15 @@ def compose_package(app_name, manifest, package_dir,
if add_class_name:
class_file = os.path.join(package_dir, 'Classes', 'mock_muranopl.yaml')
with open(class_file, 'r+') as f:
line = ''
while line != '# Write name into next line\n':
line = f.readline()
f.write('Name: {0}'.format(app_name))
with open(class_file, 'r') as f:
contents = f.readlines()
contents = ''.join(contents)
index = contents.index('Extends')
contents = "{0}Name: {1}\n\n{2}".format(contents[:index], app_name,
contents[index:])
with open(class_file, 'w') as f:
f.write(contents)
name = app_name + '.zip'