]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
add a helper to append contents to a file
authorAlfredo Deza <alfredo.deza@inktank.com>
Thu, 7 Nov 2013 16:29:39 +0000 (11:29 -0500)
committerAlfredo Deza <alfredo.deza@inktank.com>
Fri, 8 Nov 2013 15:27:25 +0000 (10:27 -0500)
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
ceph_deploy/hosts/remotes.py

index 55d056493b2f37e8dddcfefe2a0f889672f8ead6..62766f7720b544ab73e9b6d8da086af201a3927b 100644 (file)
@@ -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)