From: Ondrej Lichtner <olichtne(a)redhat.com>
Looks like I used the entire Location header instead of just the id at
the end.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Controller/PerfRepo.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lnst/Controller/PerfRepo.py b/lnst/Controller/PerfRepo.py
index 3bfa2aa..902820d 100644
--- a/lnst/Controller/PerfRepo.py
+++ b/lnst/Controller/PerfRepo.py
@@ -766,7 +766,8 @@ class PerfRepoRESTAPI(object):
logging.debug(response.text)
return None
else:
- test.set_id(response.headers['Location'])
+ new_id = response.headers["Location"].split('/')[-1]
+ test.set_id(new_id)
return test
def test_add_metric(self, test_id, metric):
@@ -776,7 +777,8 @@ class PerfRepoRESTAPI(object):
logging.debug(response.text)
return None
else:
- metric.set_id(response.headers['Location'])
+ new_id = response.headers["Location"].split('/')[-1]
+ metric.set_id(new_id)
return metric
def test_remove(self, test_id):
@@ -812,7 +814,8 @@ class PerfRepoRESTAPI(object):
logging.debug(response.text)
return None
else:
- testExec.set_id(response.headers['Location'])
+ new_id = response.headers["Location"].split('/')[-1]
+ testExec.set_id(new_id)
return testExec
def testExecution_delete(self, testExec_id):
--
2.5.2