Virt: re-write and refactor save_build() utility function
commitdffc9aaffded718698eec23aa73d4a544b3424c1
authorlmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4>
Wed, 29 Jun 2011 12:30:15 +0000 (29 12:30 +0000)
committerlmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4>
Wed, 29 Jun 2011 12:30:15 +0000 (29 12:30 +0000)
tree900919b4c47423c89fe26d9a15a344e98c5f667d
parentba37687e1663e4fe5925b665f2d6b986185921cd
Virt: re-write and refactor save_build() utility function

The save_build() has a rather specific name, but its purpose is really
general in nature: to archive a given directory (build dir) as a tarball
file somewhere (dest_dir).

This patch:
 * Renames save_build() to archive_as_tarball()
 * Moves it to virt_utils
 * Adds more flexiblity with regards to naming the tarball
 * Adds more flexiblity with regards to compression
 * Avoids using external 'tar' command by using 'tarfile' module
 * Adds more unittests

Signed-off-by: Cleber Rosa <crosa@redhat.com>
git-svn-id: svn://test.kernel.org/autotest/trunk@5469 592f7852-d20e-0410-864c-8624ca9c26a4
client/virt/kvm_installer.py
client/virt/virt_installer.py
client/virt/virt_utils.py
client/virt/virt_utils_unittest.py