test_vnf_alarm_respawn functional test is broken due to change to the Client interface
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-tackerclient |
Fix Released
|
Undecided
|
Niraj Singh |
Bug Description
Tacker functional test "test_vnf_
ft3.1: tacker.
File "tacker/
'alarm and respawn-vnf')
File "tacker/
self.
File "tacker/
self.
AttributeError: 'Client' object has no attribute 'post'
Recently, client interface has been changed in patch [1].
class Client(ClientBase) has been changed to class Client(object) due to the introduction of VNF package support. As the endpoint URL syntax is different from the legacy one, facade design pattern was introduced which seems like broken.
In ClientBase class, post/delete/
IMO, to support back compatibility with old client interface, we will need to add methods post/delete/
Sample code:
diff --git a/tackerclient/
index 742184d..e007dfc 100644
--- a/tackerclient/
+++ b/tackerclient/
@@ -994,3 +994,9 @@ class Client(object):
def delete_
return self.vnf_
+
+ def post(self, action, body=None, headers=None, params=None):
+ # Do not retry POST requests to avoid the orphan objects problem.
+ return self.legacy_
+ headers=headers, params=params)
+
Changed in python-tackerclient: | |
assignee: | nobody → Niraj Singh (nirajsingh) |
status: | New → In Progress |
Sample code shared in the description is incorrect.
I think it should be:-
diff --git a/tackerclient/ v1_0/client. py b/tackerclient/ v1_0/client. py v1_0/client. py v1_0/client. py
index 742184d..e007dfc 100644
--- a/tackerclient/
+++ b/tackerclient/
@@ -994,3 +994,9 @@ class Client(object):
def delete_ vnf_package( self, vnf_package): package_ client. delete_ vnf_package( vnf_package) client. post(action, body=body, headers=headers, params=params)
return self.vnf_
+
+ def post(self, action, body=None, headers=None, params=None):
+ # Do not retry POST requests to avoid the orphan objects problem.
+ return self.legacy_
+