def get_pool_name_filter_regex(configuration):
 pool_patterns = (configuration.netapp_pool_name_search_pattern or '(.+)')
 pool_patterns = '|'.join([(('^' + pool_pattern.strip('^$  DCTB ')) + '$') for pool_pattern in pool_patterns.split(',')])
 try:
  return re.compile(pool_patterns)
 except re.error:
  raise exception.InvalidConfigurationValue(option='netapp_pool_name_search_pattern', value=configuration.netapp_pool_name_search_pattern)

def get_pool_name_filter_regex ( configuration ) : pool_patterns = ( configuration . netapp_pool_name_search_pattern or '(.+)' ) pool_patterns = '|' . join ( [ ( ( '^' + pool_pattern . strip ( '^$  DCTB ' ) ) + '$' ) for pool_pattern in pool_patterns . split ( ',' ) ] ) try : return re . compile ( pool_patterns ) except re . error : raise exception . InvalidConfigurationValue ( option = 'netapp_pool_name_search_pattern' , value = configuration . netapp_pool_name_search_pattern )
build the regex for filtering pools by name .