Add a function that returns contents of a file from a unit

This commit is contained in:
Edin Sarajlic
2019-09-19 12:18:43 +10:00
parent 9bceee55c8
commit 27bd15a9e0
+5
View File
@@ -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.