Skip to content

Commit e6f9d1f

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "ensure samples folder exists for microversion"
2 parents 1ddb8f8 + 6c5636b commit e6f9d1f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

nova/tests/functional/api_samples_test_base.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,11 @@ def _write_template(self, name, data):
135135
outf.write(data)
136136

137137
def _write_sample(self, name, data):
138-
with open(self._get_sample(
139-
name, self.microversion), 'w') as outf:
138+
sample_file = self._get_sample(name, self.microversion)
139+
140+
os.makedirs(os.path.dirname(sample_file), exist_ok = True)
141+
142+
with open(sample_file, 'w') as outf:
140143
outf.write(data)
141144

142145
def _compare_result(self, expected, result, result_str):

0 commit comments

Comments
 (0)