]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commit
[RM-11694] Add optional directory to write_file()
authorTravis Rhoden <trhoden@redhat.com>
Fri, 22 May 2015 14:33:07 +0000 (10:33 -0400)
committerTravis Rhoden <trhoden@redhat.com>
Fri, 22 May 2015 14:33:07 +0000 (10:33 -0400)
commit628bd9ed6bfb84821ba7d2240cc41a8783cc4617
treeaa439672b31caa8c7ad901d06a8521ae44281c34
parentab240e32061ba5f89fca3d145fa229e8c8284edd
[RM-11694] Add optional directory to write_file()

This is mostly for testing purposes.  The method has no way to
specify a directory independently from the file name, which it
makes it difficult to use with automated tests.  It will get
refactored more later, but for now add a new kwarg that pass
in a dir to write to.  Since a lot of callers are passing in
absolute paths (.e.g. "/etc/ceph/keyring"), we look for the
beginning slash and chop it off so that we can use os.path.join()
and write into something like /tmp/etc/ceph.

Signed-off-by: Travis Rhoden <trhoden@redhat.com>
ceph_deploy/hosts/remotes.py