예제 #1
0
    def setUp(self):
        super(VHDUtilsTestCase, self).setUp()
        self._setup_mocks()
        self._vhdutils = vhdutils.VHDUtils()
        self._vhdutils._msft_vendor_id = 'fake_vendor_id'

        self.addCleanup(mock.patch.stopall)
예제 #2
0
파일: windows.py 프로젝트: skyniluyy/cinder
    def do_setup(self, context):
        """Setup the Windows Volume driver.

        Called one time by the manager after the driver is loaded.
        Validate the flags we care about
        """
        self.utils = windows_utils.WindowsUtils()
        self.vhdutils = vhdutils.VHDUtils()
예제 #3
0
 def __init__(self, *args, **kwargs):
     super(WindowsSmbfsDriver, self).__init__(*args, **kwargs)
     self.base = getattr(self.configuration,
                         'smbfs_mount_point_base',
                         CONF.smbfs_mount_point_base)
     opts = getattr(self.configuration,
                    'smbfs_mount_options',
                    CONF.smbfs_mount_options)
     self._remotefsclient = remotefs.WindowsRemoteFsClient(
         'cifs', root_helper=None, smbfs_mount_point_base=self.base,
         smbfs_mount_options=opts)
     self.vhdutils = vhdutils.VHDUtils()
예제 #4
0
 def setUp(self):
     super(VHDUtilsTestCase, self).setUp()
     windows_utils.WindowsUtils.__init__ = lambda x: None
     vhdutils.VHDUtils.__init__ = lambda x: None
     self.wutils = windows_utils.WindowsUtils()
     self.wutils.check_ret_val = mock.MagicMock()
     self.vhdutils = vhdutils.VHDUtils()
     self.vhdutils._conn = mock.MagicMock()
     self.vhdutils.utils = self.wutils
     self.mock_img_svc = (
         self.vhdutils._conn.Msvm_ImageManagementService()[0])
     self.vhdutils._get_resize_method = mock.Mock(
         return_value=self.mock_img_svc.ExpandVirtualHardDisk)
예제 #5
0
 def fake_get_vhdutils():
     return vhdutils.VHDUtils()