Hard code top package name

Using the package name to identify the top module name can cause issues
if the package is renamed for any reasons. Hard coding the top module
ensures more resiliency towards these types of accidental failures
and provides an obvious mapping for the file names.

Change-Id: I9542ba8f01f57b1b3473185c42d95d99ad1e8435
This commit is contained in:
Andras Kovi 2018-02-22 14:16:10 +01:00
parent 7423a58365
commit ce454f5f26

View File

@ -36,7 +36,6 @@ import pkg_resources as pkg
import random
from mistral import exceptions as exc
from mistral import version
# Thread local storage.
@ -176,10 +175,7 @@ def update_dict(left, right):
def get_file_list(directory):
base_path = pkg.resource_filename(
version.version_info.package,
directory
)
base_path = pkg.resource_filename("mistral", directory)
return [path.join(base_path, f) for f in os.listdir(base_path)
if path.isfile(path.join(base_path, f))]