From 6f96219023ff5b1371eca49aca6facaa6f3f03ae Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 26 Sep 2021 00:55:29 -0400 Subject: [PATCH] Use re.search instead of re.match Required since we're not matching the start of the string. --- node-daemon/pvcnoded/objects/CephInstance.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node-daemon/pvcnoded/objects/CephInstance.py b/node-daemon/pvcnoded/objects/CephInstance.py index 304cae04..09cefd84 100644 --- a/node-daemon/pvcnoded/objects/CephInstance.py +++ b/node-daemon/pvcnoded/objects/CephInstance.py @@ -26,7 +26,7 @@ import psutil import daemon_lib.common as common from distutils.util import strtobool -from re import match +from re import search class CephOSDInstance(object): @@ -339,10 +339,10 @@ class CephOSDInstance(object): raise Exception # Handle the partition ID portion - if match(r'by-path', device) or match(r'by-id', device): + if search(r'by-path', device) or search(r'by-id', device): # /dev/disk/by-path/pci-0000:03:00.0-scsi-0:1:0:0 -> pci-0000:03:00.0-scsi-0:1:0:0-part1 partition = '{}-part1'.format(device) - elif match(r'nvme', device): + elif search(r'nvme', device): # /dev/nvme0n1 -> nvme0n1p1 partition = '{}p1'.format(device) else: