Skip to content

Commit

Permalink
Move disk related APIs into utils_disk
Browse files Browse the repository at this point in the history
This commit moves disk specific apis to utils_disk.

Signed-off-by: Srikanth Aithal <[email protected]>
  • Loading branch information
Srikanth Aithal committed Jul 30, 2019
1 parent 586b365 commit 1a7b29a
Show file tree
Hide file tree
Showing 4 changed files with 395 additions and 408 deletions.
5 changes: 3 additions & 2 deletions virttest/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from virttest import iscsi
from virttest import utils_misc
from virttest import utils_disk
from virttest import virt_vm
from virttest import gluster
from virttest import lvm
Expand Down Expand Up @@ -259,15 +260,15 @@ def copy_nfs_image(params, image_name, root_dir):
base_dir = params.get("images_base_dir", data_dir.get_data_dir())
dst = get_image_filename(params, base_dir)
if(not os.path.isfile(dst) or
utils_misc.get_image_info(dst)['lcounts'].lower() == "true"):
utils_disk.get_image_info(dst)['lcounts'].lower() == "true"):
source = os.path.join(root_dir, "images", image_name)
if image_format not in source:
source = "%s.%s" % (source, image_format)
logging.debug("Checking for image available in image data "
"path - %s", source)
# check for image availability in images data directory
if(os.path.isfile(source) and not
utils_misc.get_image_info(source)['lcounts'].lower() == "true"):
utils_disk.get_image_info(source)['lcounts'].lower() == "true"):
logging.debug("Copying guest image from %s to %s", source,
dst)
shutil.copy(source, dst)
Expand Down
Loading

0 comments on commit 1a7b29a

Please sign in to comment.