Browse Source

Fix case sensitive path comparisons

While Windows paths are case insensitive, a few os-win checks are
case sensitive and are addressed by this patch.

Change-Id: I60c0d3e12501d7b2f62df8f95a3d3f328de83817
Closes-Bug: #1878588
(cherry picked from commit 94046df43a)
tags/4.3.3^0
Lucian Petrut 2 months ago
parent
commit
3bdedd9f38
3 changed files with 8 additions and 5 deletions
  1. +2
    -1
      os_win/utils/compute/vmutils.py
  2. +4
    -2
      os_win/utils/compute/vmutils10.py
  3. +2
    -2
      os_win/utils/hostutils10.py

+ 2
- 1
os_win/utils/compute/vmutils.py View File

@@ -1064,7 +1064,8 @@ class VMUtils(baseutils.BaseUtilsVirt):
# need to accept Msvm_DiskDrive object paths for image files as well,
# an extra check will be needed, but that may lead to some other
# inconsistencies.
is_physical = r'root\virtualization\v2:Msvm_DiskDrive' in drive_path
is_physical = (r'root\virtualization\v2:Msvm_DiskDrive'.lower() in
drive_path.lower())
drive = self._get_mounted_disk_resource_from_path(
drive_path, is_physical=is_physical)



+ 4
- 2
os_win/utils/compute/vmutils10.py View File

@@ -229,7 +229,8 @@ class VMUtils10(vmutils.VMUtils6_3):

pattern = re.compile(
"^(.*)VEN_%(vendor_id)s&DEV_%(product_id)s&(.*)$" % {
'vendor_id': vendor_id, 'product_id': product_id})
'vendor_id': vendor_id, 'product_id': product_id},
re.IGNORECASE)
for dev in pci_devices:
if pattern.match(dev.DeviceID):
# NOTE(claudiub): if the given PCI device is already assigned,
@@ -260,7 +261,8 @@ class VMUtils10(vmutils.VMUtils6_3):

pattern = re.compile(
"^(.*)VEN_%(vendor_id)s&DEV_%(product_id)s&(.*)$" % {
'vendor_id': vendor_id, 'product_id': product_id})
'vendor_id': vendor_id, 'product_id': product_id},
re.IGNORECASE)

pci_sds = _wqlutils.get_element_associated_class(
self._conn, self._PCI_EXPRESS_SETTING_DATA,


+ 2
- 2
os_win/utils/hostutils10.py View File

@@ -27,8 +27,8 @@ class HostUtils10(hostutils.HostUtils):

_HGS_NAMESPACE = '//%s/Root/Microsoft/Windows/Hgs'

_PCI_VENDOR_ID_REGEX = re.compile('VEN_(.*)&DEV')
_PCI_PRODUCT_ID_REGEX = re.compile('DEV_(.*)&SUBSYS')
_PCI_VENDOR_ID_REGEX = re.compile('VEN_(.*)&DEV', re.IGNORECASE)
_PCI_PRODUCT_ID_REGEX = re.compile('DEV_(.*)&SUBSYS', re.IGNORECASE)
_PCI_ADDRESS_REGEX = re.compile(r'\b\d+\b')

def __init__(self, host='.'):


Loading…
Cancel
Save