From 27bd15a9e0cac4958a85b7eba9999e387dc7e808 Mon Sep 17 00:00:00 2001 From: Edin Sarajlic Date: Thu, 19 Sep 2019 12:18:43 +1000 Subject: [PATCH] Add a function that returns contents of a file from a unit --- zaza/openstack/utilities/generic.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zaza/openstack/utilities/generic.py b/zaza/openstack/utilities/generic.py index b2f7354..8b562ab 100644 --- a/zaza/openstack/utilities/generic.py +++ b/zaza/openstack/utilities/generic.py @@ -716,6 +716,11 @@ def get_ubuntu_release(ubuntu_name): return index +def get_file_contents(unit, f): + return model.run_on_unit(unit.entity_id, + "cat {}".format(f))['Stdout'] + + def is_port_open(port, address): """Determine if TCP port is accessible.