Skip to content

Commit 1c19501

Browse files
authored
Merge pull request #74 from PanDAWMS/api_init
panda_api: initialize username and better handling of task-vs-username parameter handling in show()
2 parents 5b078e7 + fd58470 commit 1c19501

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

pandaclient/PBookCore.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,10 @@ def show(
317317
):
318318
# user name
319319
if username is None:
320-
username = self.username
320+
# if the task ID or task name are specified, ignore the username to avoid strange behaviour
321+
if not some_ids and not taskname and not jeditaskid:
322+
username = self.username
323+
321324
# shortcut of jeditaskid and reqid
322325
if isinstance(some_ids, (int, long)):
323326
if is_reqid(some_ids):

pandaclient/PandaToolsPkgInfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
release_version = "1.6.12"
1+
release_version = "1.6.13"

pandaclient/panda_api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def get_tasks(self, task_ids=None, limit=1000, days=14, status=None, username=No
9494
"""
9595
if not self.pbook:
9696
self.pbook = PBookCore.PBookCore()
97+
self.pbook.init()
9798
return self.pbook.show(task_ids, limit=limit, days=days, format="json", status=status, username=username)
9899

99100
# show tasks
@@ -111,6 +112,7 @@ def show_tasks(self, task_ids=None, limit=1000, days=14, format="standard", stat
111112
"""
112113
if not self.pbook:
113114
self.pbook = PBookCore.PBookCore()
115+
self.pbook.init()
114116
self.pbook.show(task_ids, limit=limit, days=days, format=format, status=status, username=username)
115117

116118
# submit a task
@@ -141,6 +143,7 @@ def get_job_metadata(self, task_id, output_json_filename):
141143
"""
142144
if not self.pbook:
143145
self.pbook = PBookCore.PBookCore()
146+
self.pbook.init()
144147
return self.pbook.getUserJobMetadata(task_id, output_json_filename)
145148

146149
# execute xyz

0 commit comments

Comments
 (0)