diff options
Diffstat (limited to 'functest/core/cloudify.py')
-rw-r--r-- | functest/core/cloudify.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/functest/core/cloudify.py b/functest/core/cloudify.py index 21bfc937e..b5a959412 100644 --- a/functest/core/cloudify.py +++ b/functest/core/cloudify.py @@ -74,10 +74,11 @@ class Cloudify(singlevm.SingleVm2): "--cap-add SYS_ADMIN --network=host {}".format( os.path.basename(self.cloudify_archive), self.cloudify_container)) - self.__logger.debug("output:\n%s", stdout.read()) - self.__logger.debug("error:\n%s", stderr.read()) + self.__logger.debug("output:\n%s", stdout.read().decode("utf-8")) + self.__logger.debug("error:\n%s", stderr.read().decode("utf-8")) self.cfy_client = CloudifyClient( - host=self.fip.floating_ip_address, + host=self.fip.floating_ip_address if self.fip else ( + self.sshvm.public_v4), username='admin', password='admin', tenant='default_tenant') self.__logger.info("Attemps running status of the Manager") secret_key = "foo" @@ -124,8 +125,8 @@ class Cloudify(singlevm.SingleVm2): "cfy_manager_local:/etc/cloudify/ && " "sudo docker exec cfy_manager_local " "chmod 444 /etc/cloudify/cloudify_ims.pem") - self.__logger.debug("output:\n%s", stdout.read()) - self.__logger.debug("error:\n%s", stderr.read()) + self.__logger.debug("output:\n%s", stdout.read().decode("utf-8")) + self.__logger.debug("error:\n%s", stderr.read().decode("utf-8")) def upload_cfy_plugins(self, yaml, wgn): """Upload Cloudify plugins""" @@ -133,8 +134,8 @@ class Cloudify(singlevm.SingleVm2): "sudo docker exec cfy_manager_local " "cfy plugins upload -y {} {} && " "sudo docker exec cfy_manager_local cfy status".format(yaml, wgn)) - self.__logger.debug("output:\n%s", stdout.read()) - self.__logger.debug("error:\n%s", stderr.read()) + self.__logger.debug("output:\n%s", stdout.read().decode("utf-8")) + self.__logger.debug("error:\n%s", stderr.read().decode("utf-8")) def kill_existing_execution(self, dep_name): """kill existing execution""" @@ -147,7 +148,7 @@ class Cloudify(singlevm.SingleVm2): self.cfy_client.executions.cancel( execution['id'], force=True) except Exception: # pylint: disable=broad-except - self.__logger.warn("Can't cancel the current exec") + self.__logger.warning("Can't cancel the current exec") execution = self.cfy_client.executions.start( dep_name, 'uninstall', parameters=dict(ignore_failure=True)) wait_for_execution(self.cfy_client, execution, self.__logger) @@ -191,9 +192,8 @@ def wait_for_execution(client, execution, logger, timeout=3600, ): 'execution of operation {0} for deployment {1} ' 'timed out'.format(execution.workflow_id, execution.deployment_id)) - else: - # update the remaining timeout - timeout = deadline - time.time() + # update the remaining timeout + timeout = deadline - time.time() if not execution_ended: execution = client.executions.get(execution.id) |