# Path: virtinst/CloneManager.py
# def _listify(val):
# def generate_clone_disk_path(origpath, design, newname=None):
# def generate_clone_name(design):
#     def __init__(self, connection=None, conn=None):
#     def get_original_guest(self):
#     def set_original_guest(self, original_guest):
#     def set_original_xml(self, val):
#     def get_original_xml(self):
#     def get_clone_name(self):
#     def set_clone_name(self, name):
#     def set_clone_uuid(self, uuid):
#     def get_clone_uuid(self):
#     def set_clone_devices(self, devpath):
#     def get_clone_devices(self):
#     def get_clone_virtual_disks(self):
#     def set_clone_mac(self, mac):
#     def get_clone_mac(self):
#     def get_clone_bs(self):
#     def set_clone_bs(self, rate):
#     def get_original_devices_size(self):
#     def get_original_devices(self):
#     def get_original_virtual_disks(self):
#     def get_hyper_conn(self):
#     def set_hyper_conn(self, conn):
#     def get_original_dom(self):
#     def get_clone_xml(self):
#     def set_clone_xml(self, clone_xml):
#     def get_clone_sparse(self):
#     def set_clone_sparse(self, flg):
#     def get_preserve(self):
#     def set_preserve(self, flg):
#     def get_preserve_dest_disks(self):
#     def set_force_target(self, dev):
#     def get_force_target(self):
#     def set_skip_target(self, dev):
#     def get_skip_target(self):
#     def set_clone_policy(self, policy_list):
#     def get_clone_policy(self):
#     def get_clone_running(self):
#     def set_clone_running(self, val):
#     def _get_replace(self):
#     def _set_replace(self, val):
#     def setup_original(self):
#     def setup_clone(self):
#     def setup(self):
#     def remove_original_vm(self, force=None):
#     def _check_mac(self, mac):
#     def _change_storage_xml(self, ctx, orig_disk, clone_disk):
#     def _get_original_devices_info(self, xml):
#     def _do_we_clone_device(self, xml, i):
#     def _lookup_vm(self, name):
# def start_duplicate(design, meter=None):
# def _do_duplicate(design, meter):
# class CloneDesign(object):
#     CLONE_POLICY_NO_READONLY   = 1
#     CLONE_POLICY_NO_SHAREABLE  = 2
#     CLONE_POLICY_NO_EMPTYMEDIA = 3


import unittest
import os
import logging
import utils
from virtinst import CloneManager
        try:
            CloneManager._util.is_uri_remote = fake_is_uri_remote

            for base in [ "nostorage", "noclone-storage" ] :
                self._clone_helper(base, disks=[])

        finally:
            CloneManager._util.is_uri_remote = oldfunc

    def testRemoteWithStorage(self):
        """
        Test remote clone with storage needing cloning. Should fail,
        since libvirt has no storage clone api.
        """
        oldfunc = CloneManager._util.is_uri_remote
        try:
            CloneManager._util.is_uri_remote = fake_is_uri_remote

            for base in [ "general-cfg" ] :
                try:
                    self._clone_helper(base, disks=["%s/1.img" % POOL1,
                                                    "%s/2.img" % POOL1])

                    # We shouldn't succeed, so test fails
                    raise AssertionError("Remote clone with storage passed "
                                         "when it shouldn't.")
                except (ValueError, RuntimeError), e:
                    # Exception expected
                    logging.debug("Received expected exception: %s", str(e))
        finally:

# Path: virtinst/CloneManager.py
# def _listify(val):
# def generate_clone_disk_path(origpath, design, newname=None):
# def generate_clone_name(design):
#     def __init__(self, connection=None, conn=None):
#     def get_original_guest(self):
#     def set_original_guest(self, original_guest):
#     def set_original_xml(self, val):
#     def get_original_xml(self):
#     def get_clone_name(self):
#     def set_clone_name(self, name):
#     def set_clone_uuid(self, uuid):
#     def get_clone_uuid(self):
#     def set_clone_devices(self, devpath):
#     def get_clone_devices(self):
#     def get_clone_virtual_disks(self):
#     def set_clone_mac(self, mac):
#     def get_clone_mac(self):
#     def get_clone_bs(self):
#     def set_clone_bs(self, rate):
#     def get_original_devices_size(self):
#     def get_original_devices(self):
#     def get_original_virtual_disks(self):
#     def get_hyper_conn(self):
#     def set_hyper_conn(self, conn):
#     def get_original_dom(self):
#     def get_clone_xml(self):
#     def set_clone_xml(self, clone_xml):
#     def get_clone_sparse(self):
#     def set_clone_sparse(self, flg):
#     def get_preserve(self):
#     def set_preserve(self, flg):
#     def get_preserve_dest_disks(self):
#     def set_force_target(self, dev):
#     def get_force_target(self):
#     def set_skip_target(self, dev):
#     def get_skip_target(self):
#     def set_clone_policy(self, policy_list):
#     def get_clone_policy(self):
#     def get_clone_running(self):
#     def set_clone_running(self, val):
#     def _get_replace(self):
#     def _set_replace(self, val):
#     def setup_original(self):
#     def setup_clone(self):
#     def setup(self):
#     def remove_original_vm(self, force=None):
#     def _check_mac(self, mac):
#     def _change_storage_xml(self, ctx, orig_disk, clone_disk):
#     def _get_original_devices_info(self, xml):
#     def _do_we_clone_device(self, xml, i):
#     def _lookup_vm(self, name):
# def start_duplicate(design, meter=None):
# def _do_duplicate(design, meter):
# class CloneDesign(object):
#     CLONE_POLICY_NO_READONLY   = 1
#     CLONE_POLICY_NO_SHAREABLE  = 2
#     CLONE_POLICY_NO_EMPTYMEDIA = 3


# Path: tests/clonetest.py
import unittest
import os
import logging
import utils
from virtinst import CloneManager

        try:
            CloneManager._util.is_uri_remote = fake_is_uri_remote

            for base in [ "nostorage", "noclone-storage" ] :
                self._clone_helper(base, disks=[])

        finally:
            CloneManager._util.is_uri_remote = oldfunc

    def testRemoteWithStorage(self):
        """
        Test remote clone with storage needing cloning. Should fail,
        since libvirt has no storage clone api.
        """
        oldfunc = CloneManager._util.is_uri_remote
        try:
            CloneManager._util.is_uri_remote = fake_is_uri_remote

            for base in [ "general-cfg" ] :
                try:
                    self._clone_helper(base, disks=["%s/1.img" % POOL1,
                                                    "%s/2.img" % POOL1])

                    # We shouldn't succeed, so test fails
                    raise AssertionError("Remote clone with storage passed "
                                         "when it shouldn't.")
                except (ValueError, RuntimeError), e:
                    # Exception expected
                    logging.debug("Received expected exception: %s", str(e))
        finally:

            CloneManager._util.is_uri_remote = oldfunc