Skip to content

Commit c985234

Browse files
committed
revert changes when dealing with local status.db before
1 parent d6ca6aa commit c985234

2 files changed

Lines changed: 7 additions & 44 deletions

File tree

workflowmonit/workflowCollector.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -72,26 +72,6 @@ def invalidate_caches(cacheDir=None):
7272
pass
7373

7474

75-
def _get_workflow_from_status(path):
76-
'''
77-
get a dict of :py:class:`WorkflowInfo` objects by parsing the statuses.json file given the path.
78-
{'workflow' : WorkflowInfo}
79-
80-
:param str path: path of statuses.json
81-
:returns: dict of :py:class:`WorkflowInfo` with its string as key
82-
83-
:rtype: dict
84-
'''
85-
86-
wf_dict = {}
87-
88-
wfs = errorutils.get_workflow_list_from_location(path)
89-
if wfs:
90-
wf_dict = {wf: workflowinfo.WorkflowInfo(wf) for wf in wfs}
91-
92-
return wf_dict
93-
94-
9575
def get_workflowlist_from_db(config, queryCmd):
9676
'''
9777
get a list of workflows from oracle db from a config dictionary which has a ``oracle`` key.

workflowwebtools/errorutils.py

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ def errors_from_list(workflows):
4141
return indict
4242

4343

44-
def get_workflow_list_from_location(data_location):
44+
def open_location(data_location):
4545
"""
4646
This function assumes that the contents of the location is in JSON format.
47-
It opens the data location and returns the list of workflows.
47+
It opens the data location and returns the dictionary.
4848
4949
:param str data_location: The location of the file or url
50-
:returns: workflow list
51-
:rtype: list
50+
:returns: information in the JSON file
51+
:rtype: dict
5252
"""
5353
config_dict = serverconfig.config_dict()
5454

@@ -60,7 +60,7 @@ def get_workflow_list_from_location(data_location):
6060
wkfs = [row for row, in oracle_cursor]
6161
oracle_db_conn.close()
6262
cherrypy.log('Number of workflows from database: %i' % len(wkfs))
63-
return wkfs
63+
return errors_from_list(wkfs)
6464

6565
raw = None
6666

@@ -87,27 +87,10 @@ def get_workflow_list_from_location(data_location):
8787
if not (keys and isinstance(raw[keys[0]], list)):
8888
return raw
8989

90-
return [
90+
return errors_from_list([
9191
workflow for workflow, statuses in raw.iteritems()
9292
if True in ['manual' in status for status in statuses]
93-
]
94-
95-
96-
def open_location(data_location):
97-
"""
98-
This function assumes that the contents of the location is in JSON format.
99-
It opens the data location and returns the dictionary.
100-
101-
:param str data_location: The location of the file or url
102-
:returns: information in the JSON file
103-
:rtype: dict
104-
"""
105-
wkfs = get_workflow_list_from_location(data_location)
106-
107-
if wkfs:
108-
return errors_from_list(wkfs)
109-
else:
110-
return None
93+
])
11194

11295

11396
def get_list_info(status_list):

0 commit comments

Comments
 (0)