mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 13:21:28 +00:00
Bug 1415618: Use path relative to mozharness config modules to find configs. r=jlund
MozReview-Commit-ID: 6D6QEz9ulYX --HG-- extra : rebase_source : c41158494fe748d94706bb72d3566d978160f793
This commit is contained in:
parent
fc654248b1
commit
d9568dac66
@ -135,6 +135,8 @@ class ReadOnlyDict(dict):
|
||||
result[k] = deepcopy(v, memo)
|
||||
return result
|
||||
|
||||
DEFAULT_CONFIG_PATH = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "configs")
|
||||
|
||||
# parse_config_file {{{1
|
||||
def parse_config_file(file_name, quiet=False, search_path=None,
|
||||
config_dict_name="config"):
|
||||
@ -145,8 +147,7 @@ def parse_config_file(file_name, quiet=False, search_path=None,
|
||||
file_path = file_name
|
||||
else:
|
||||
if not search_path:
|
||||
search_path = ['.', os.path.join(sys.path[0], '..', 'configs'),
|
||||
os.path.join(sys.path[0], '..', '..', 'configs')]
|
||||
search_path = ['.', DEFAULT_CONFIG_PATH]
|
||||
for path in search_path:
|
||||
if os.path.exists(os.path.join(path, file_name)):
|
||||
file_path = os.path.join(path, file_name)
|
||||
|
@ -26,7 +26,7 @@ from itertools import chain
|
||||
import sys
|
||||
from datetime import datetime
|
||||
import re
|
||||
from mozharness.base.config import BaseConfig, parse_config_file
|
||||
from mozharness.base.config import BaseConfig, parse_config_file, DEFAULT_CONFIG_PATH
|
||||
from mozharness.base.log import ERROR, OutputParser, FATAL
|
||||
from mozharness.base.script import PostScriptRun
|
||||
from mozharness.base.vcs.vcsbase import MercurialScript
|
||||
@ -400,8 +400,7 @@ class BuildOptionParser(object):
|
||||
platform = None
|
||||
bits = None
|
||||
config_file_search_path = [
|
||||
'.', os.path.join(sys.path[0], '..', 'configs'),
|
||||
os.path.join(sys.path[0], '..', '..', 'configs')
|
||||
DEFAULT_CONFIG_PATH,
|
||||
]
|
||||
|
||||
# add to this list and you can automagically do things like
|
||||
|
Loading…
x
Reference in New Issue
Block a user