mapaction / mapactionpy_controller

7 stars 6 forks source link

Ungraceful exit if JIRA authentication fails #92

Open andrewphilipsmith opened 4 years ago

andrewphilipsmith commented 4 years ago

How to recreate:

  1. pip install jira
  2. pip install <mapactionpy_arcmap|mapactionpy_qgis>
  3. Ensure that the required .netrc file does not exist.
  4. mapchef.exe

Expected behaviour

The JIRA integration component should fail gracefully, simular to the behaviour is the python package jira is not present.

Actual behaviour

Traceback (most recent call last):
  File "C:\py27arcgis106\ArcGIS10.6\Lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\py27arcgis106\ArcGIS10.6\Lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\gocd\agent\pipelines\kenya2\env\Scripts\mapchef.exe\__main__.py", line 4, in <module>
  File "c:\gocd\agent\pipelines\kenya2\env\lib\site-packages\mapactionpy_controller\cli.py", line 7, in <module>
    from mapactionpy_controller.main_stack import process_stack
  File "c:\gocd\agent\pipelines\kenya2\env\lib\site-packages\mapactionpy_controller\main_stack.py", line 33, in <module>
    jira_client = get_jira_client()
  File "c:\gocd\agent\pipelines\kenya2\env\lib\site-packages\mapactionpy_controller\main_stack.py", line 28, in get_jira_client
    return JiraClient()
  File "c:\gocd\agent\pipelines\kenya2\env\lib\site-packages\mapactionpy_controller\jira_tasks.py", line 37, in __init__
    secrets = netrc.netrc(netrc_path)
  File "C:\py27arcgis106\ArcGIS10.6\Lib\netrc.py", line 34, in __init__
    with open(file) as fp:
IOError: [Errno 2] No such file or directory: 'C:\\Users\\MapAction\\.netrc'