From: Alfredo Deza Date: Thu, 7 Nov 2013 16:29:39 +0000 (-0500) Subject: add a helper to append contents to a file X-Git-Tag: v1.3.2~10^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=76a33201b6150dcf5fc99203eba9087047aa9c5a;p=ceph-deploy.git add a helper to append contents to a file Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/hosts/remotes.py b/ceph_deploy/hosts/remotes.py index 55d0564..62766f7 100644 --- a/ceph_deploy/hosts/remotes.py +++ b/ceph_deploy/hosts/remotes.py @@ -88,6 +88,12 @@ def create_init_path(init_path): pass +def append_to_file(file_path, contents): + """append contents to file""" + with open(file_path, 'a') as f: + f.write(contents) + + def path_exists(path): return os.path.exists(path)