From 5d67b049f16a92b86d48149dbd667fce258405d9 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Sun, 22 Jul 2018 15:25:07 +0200 Subject: Add secrets operations in cloudify.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It tries to prevent race conditions when running cloudify_ims. Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/functest/core/singlevm.py", line 411, in run if not self.execute(): File "/usr/lib/python2.7/site-packages/functest/opnfv_tests/vnf/ims/cloudify_ims.py", line 120, in execute self.cfy_client.secrets.create(k, val) File "/usr/lib/python2.7/site-packages/cloudify_rest_client/secrets.py", line 86, in create response = self.api.put('/secrets/{0}'.format(key), data=data) File "/usr/lib/python2.7/site-packages/cloudify_rest_client/client.py", line 263, in put timeout=timeout) File "/usr/lib/python2.7/site-packages/cloudify_rest_client/client.py", line 233, in do_request 'SSL, but the client does'.format(e) ConnectionError: ('Connection aborted.', BadStatusLine("''",)) Change-Id: Id2603bbda462b50d3140b6f45894c8810d542e4c Signed-off-by: Cédric Ollivier (cherry picked from commit f426c72f2bb6381c631794a4b9f4c3322832e0d3) --- functest/core/cloudify.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/functest/core/cloudify.py b/functest/core/cloudify.py index b048ed1d4..6bef96747 100644 --- a/functest/core/cloudify.py +++ b/functest/core/cloudify.py @@ -65,8 +65,11 @@ class Cloudify(singlevm.SingleVm2): "The current manager status is %s", cfy_status) if str(cfy_status) != 'running': raise Exception("Cloudify Manager isn't up and running") - self.cfy_client.secrets.list() - self.__logger.debug("Secrets API successfully reached") + self.cfy_client.secrets.create("foo", "bar") + self.__logger.debug( + "List secrets: %s", self.cfy_client.secrets.list()) + self.cfy_client.secrets.delete("foo") + self.__logger.info("Secrets API successfully reached") break except Exception: # pylint: disable=broad-except self.__logger.info( -- cgit 1.2.3-korg