Bug #1968294 “policy regex matches more than necessary” : Bugs : puppet-openstacklib

The regex in https://github.com/openstack/puppet-openstacklib/blob/stable/yoga/manifests/policy/base.pp#L95 can match multiple policies if the policy contains ‘:’.

For example, a policy of ‘get_router’ can match both ‘get_router’ and
‘get_router:distributed’ lines.

This can be seen clearly by inputting the following into a regex checker like https://regex101.com/

regex expression:
 ^[‘”]?get_router[‘”]?\s*:.+

data:
‘get_router’: ‘rule:admin_or_owner or rule:read_only’
‘get_router:distributed’: ‘rule:admin_only or rule:read_only’

Read more here: Source link