Bug 2219373 - [RFE] provide `HostSpec` `host_pattern` matching via regex in addition to the existing `fnmatch.filter()`
Summary: [RFE] provide `HostSpec` `host_pattern` matching via regex in addition to the...
Keywords:
Status: NEW
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: Cephadm
Version: 6.2
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
: 6.2
Assignee: Adam King
QA Contact: Mohit Bisht
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-03 11:28 UTC by Harald Klein
Modified: 2023-07-06 17:55 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHCEPH-6950 0 None None None 2023-07-03 11:29:19 UTC

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)
[...]
~~~


Note You need to log in before you can comment on or make changes to this bug.