]> 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>
Tue, 26 May 2015 14:38:04 +0000 (10:38 -0400)
commit29352a303c4b40fc547524e31c95fb82ac760d97
tree6a8b980374313bf8ef976531b0014c48ca764beb
parentc1eeabc4f87dfaa34abaaca0dd2b8398a1528de1
[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>
(cherry picked from commit 628bd9ed6bfb84821ba7d2240cc41a8783cc4617)
ceph_deploy/hosts/remotes.py