Skip to content

Commit

Permalink
[pyoutline] Move outline.cfg into the outline module. (#1252)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcipriano committed Mar 1, 2023
1 parent a22391f commit deef621
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
11 changes: 4 additions & 7 deletions pyoutline/outline/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,10 @@ def read_config_from_disk():
config_file = config_from_user_profile

if not config_file:
default_config_paths = [__file_path__.parent.parent.parent / 'etc' / 'outline.cfg',
__file_path__.parent.parent / 'etc' / 'outline.cfg']
for default_config_path in default_config_paths:
logger.info('Loading default outline config from %s', default_config_path)
if default_config_path.exists():
config_file = default_config_path
break
default_config_path = __file_path__.parent / 'outline.cfg'
logger.info('Loading default outline config from %s', default_config_path)
if default_config_path.exists():
config_file = default_config_path

if not config_file:
raise FileNotFoundError('outline config file was not found')
Expand Down
File renamed without changes.
8 changes: 6 additions & 2 deletions pyoutline/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@
packages=find_packages(exclude=['tests']),
data_files=[
('bin', ['bin/cuerunbase.py', 'bin/pycuerun', 'bin/util_qc_job_layer.py']),
('etc', ['etc/outline.cfg']),
('wrappers', ['wrappers/opencue_wrap_frame', 'wrappers/opencue_wrap_frame_no_ss', 'wrappers/local_wrap_frame']),
('wrappers', [
'wrappers/opencue_wrap_frame', 'wrappers/opencue_wrap_frame_no_ss',
'wrappers/local_wrap_frame']),
],
package_data={
'outline': ['outline.cfg'],
},
test_suite='tests',
)
2 changes: 1 addition & 1 deletion pyoutline/tests/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test__should_load_default_values(self):
self.assertIsNone(os.environ.get('OL_CONF'))
self.assertIsNone(os.environ.get('OUTLINE_CONFIG_FILE'))
self.fs.add_real_file(
os.path.join(os.path.dirname(os.path.dirname(outline.__file__)), 'etc', 'outline.cfg'),
os.path.join(os.path.dirname(outline.__file__), 'outline.cfg'),
read_only=True)

config = read_config_from_disk()
Expand Down

0 comments on commit deef621

Please sign in to comment.