Example #1
0
    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()
Example #2
0
    def setUp(self):
        super(WindowsUtilsTestCase, self).setUp()

        windows_utils.WindowsUtils.__init__ = lambda x: None
        self.wutils = windows_utils.WindowsUtils()
        self.wutils._conn_wmi = mock.Mock()
        self.wutils._conn_cimv2 = mock.MagicMock()
Example #3
0
def _get_class(v1_class, v2_class):
    # V2 classes are supported starting from Hyper-V Server 2012 and
    # Windows Server 2012 (kernel version 6.2)
    if not windows_utils.WindowsUtils().check_min_windows_version(6, 2):
        cls = v2_class
    else:
        cls = v1_class
    LOG.debug("Loading class: %(module_name)s.%(class_name)s",
              {'module_name': cls.__module__, 'class_name': cls.__name__})
    return cls
Example #4
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()
     self._windows_utils = windows_utils.WindowsUtils()
Example #5
0
 def setUp(self):
     super(VHDUtilsV2TestCase, self).setUp()
     windows_utils.WindowsUtils.__init__ = lambda x: None
     vhdutilsv2.VHDUtilsV2.__init__ = lambda x: None
     self.wutils = windows_utils.WindowsUtils()
     self.wutils.check_ret_val = mock.MagicMock()
     self.vhdutilsv2 = vhdutilsv2.VHDUtilsV2()
     self.vhdutilsv2._conn = mock.MagicMock()
     self.vhdutilsv2.utils = self.wutils
     self.mock_img_svc = (
         self.vhdutilsv2._conn.Msvm_ImageManagementService()[0])
     self.vhdutilsv2._get_resize_method = mock.Mock(
         return_value=self.mock_img_svc.ResizeVirtualHardDisk)
Example #6
0
 def __init__(self):
     self.utils = windows_utils.WindowsUtils()
     self._conn = wmi.WMI(moniker='//./root/virtualization')