Bug 2219373

Summary: [RFE] provide `HostSpec` `host_pattern` matching via regex in addition to the existing `fnmatch.filter()`
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Harald Klein <hklein>
Component: CephadmAssignee: Adam King <adking>
Status: NEW --- QA Contact: Mohit Bisht <mobisht>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.2CC: cephqe-warriors
Target Milestone: ---Keywords: FutureFeature
Target Release: 6.2   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Harald Klein 2023-07-03 11:28:15 UTC
Description of problem:

Currently the `host_pattern` for the `HostSpec` only allows limited filtering (it uses the fnmatch.filter() method internally - https://docs.python.org/3/library/fnmatch.html ). Optionally allowing something like `host_pattern_regex` via python `re` would allow our customers to use more sophisticated filters. 

Version-Release number of selected component (if applicable):

all 

How reproducible:

n/a

Expected results:

regex filtering for host_patterns

Additional info:

Current filtering:
~~~
python-common/ceph/deployment/service_spec.py:
def filter_matching_hostspects(...):
[...]
        if self.host_pattern:
            return fnmatch.filter(all_hosts, self.host_pattern)
[...]
~~~