canonical / charm-openstack-service-checks

Collection of Nagios checks and other utilities that can be used to verify the operation of an OpenStack cluster
0 stars 4 forks source link

skipped_host_aggregates regexp should allow hyphens #100

Closed sudeephb closed 9 months ago

sudeephb commented 9 months ago

Current regular expression allows: alphanumeric[,alphanumeric]

import re s = "AZ-AGGR" regex = r'(\w+[,\w+]*)' re.findall(regex, s) ['AZ', 'AGGR']

However, there are host aggregates that may have hyphens or underscores.

regex = r'([\w-]+[,[\w-]+]*)' re.findall(regex, s) ['AZ-AGGR']


Imported from Launchpad using lp2gh.

sudeephb commented 9 months ago

(by aluria) updated regexp to r'([\w-]+(?:,[\w-]+)*)'