From: Alfredo Deza Date: Wed, 23 Apr 2014 20:21:00 +0000 (-0400) Subject: add helper functions to remotes X-Git-Tag: v1.5.0~9^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=52bef099b3058d94789dbcc004d29311bdef7576;p=ceph-deploy.git add helper functions to remotes Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/hosts/remotes.py b/ceph_deploy/hosts/remotes.py index 33425fe..e3f716a 100644 --- a/ceph_deploy/hosts/remotes.py +++ b/ceph_deploy/hosts/remotes.py @@ -117,10 +117,22 @@ def append_to_file(file_path, contents): f.write(contents) +def readline(path): + with open(path) as _file: + return _file.readline().strip('\n') + def path_exists(path): return os.path.exists(path) +def get_realpath(path): + return os.path.realpath(path) + + +def listdir(path): + return os.listdir(path) + + def makedir(path, ignored=None): ignored = ignored or [] try: