tempest/api/orchestration/base.py: load_template() used a restrict path
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tempest |
Fix Released
|
Undecided
|
Qiu Hua Qiao |
Bug Description
def load_template(cls, name, ext='yaml'):
loc = ["tempest", "api", "orchestration",
fullpath = os.path.join(*loc)
with open(fullpath, "r") as f:
content = f.read()
return content
The method restrict the template file in folder 'tempest/
But if we run tempests in other path(like /root/), the case will failed with this error:
[Errno 2] No such file or directory: 'tempest/
Stacktrace
Traceback (most recent call last):
File "/usr/lib/
self.setUp()
File "/usr/lib/
self.
File "/usr/lib/
try_
File "/usr/lib/
return func()
File "/tmp/tempest/
template = cls.load_
File "/tmp/tempest/
with open(fullpath, "r") as f:
IOError: [Errno 2] No such file or directory: 'tempest/
Fix proposed to branch: master /review. openstack. org/84363
Review: https:/