Skip to content

Commit

Permalink
Merge pull request #91 from teddyrendahl/move_qs_cfg
Browse files Browse the repository at this point in the history
MAINT: Rename qs.cfg to web.cfg
  • Loading branch information
ZLLentz authored Apr 6, 2018
2 parents 647bbbe + 9f09b88 commit e1bf45d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/source/hutch_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Replacing ``hutchname`` with your hutch's name:
#. Click ``New`` to make a new repo, name it ``hutchname``, do not
initialize with README, gitignore, or license.
#. ``git push origin master``
#. As the hutch operator account, create a file named ``.qs.cfg`` in the opr's
#. As the hutch operator account, create a file named ``.web.cfg`` in the opr's
home area. Follow the specification of `get_qs_objs` to ensure we can load
user objects from the questionnaire. Also include the necessary information
for reporting issues to GitHub specified in `post_to_github`
Expand Down
6 changes: 4 additions & 2 deletions hutch_python/qs_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_qs_objs(proposal, run):
There are two possible methods of authentication to the
``QuestionnaireClient``, ``Kerberos`` and ``WS-Auth``. The first is simpler
but is not possible for all users, we therefore search for a configuration
file named ``qs.cfg``, either hidden in the current directory or the users
file named ``web.cfg``, either hidden in the current directory or the users
home directory. This should contain the username and password needed to
authenticate into the ``QuestionnaireClient``. The format of this
configuration file is the standard ``.ini`` structure and should define the
Expand Down Expand Up @@ -55,7 +55,9 @@ def get_qs_objs(proposal, run):
# launch the client via Kerberos
cfg = ConfigParser()
cfgs = cfg.read(['qs.cfg', '.qs.cfg',
os.path.expanduser('~/.qs.cfg')])
os.path.expanduser('~/.qs.cfg'),
'web.cfg', '.web.cfg',
os.path.expanduser('~/.web.cfg')])
# Ws-auth
if cfgs:
user = cfg.get('DEFAULT', 'user', fallback=None)
Expand Down
4 changes: 2 additions & 2 deletions hutch_python/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ def find(self, multiples=False, **kwargs):
@pytest.fixture(scope='function')
def temporary_config():
# Write to our configuration
with open('qs.cfg', '+w') as f:
with open('web.cfg', '+w') as f:
f.write(cfg)
# Allow the test to run
yield
# Remove the file
os.remove('qs.cfg')
os.remove('web.cfg')


@pytest.fixture(scope='function')
Expand Down

0 comments on commit e1bf45d

Please sign in to comment.