def service_tags_not_in_module_path(physical_line, filename):
 if ('tempest/scenario' not in filename):
  matches = SCENARIO_DECORATOR.match(physical_line)
  if matches:
   services = matches.group(1).split(',')
   for service in services:
    service_name = service.strip().strip("'")
    modulepath = os.path.split(filename)[0]
    if (service_name in modulepath):
     return (physical_line.find(service_name), 'T107: service tag should not be in path')

def service_tags_not_in_module_path ( physical_line , filename ) : if ( 'tempest/scenario' not in filename ) : matches = SCENARIO_DECORATOR . match ( physical_line ) if matches : services = matches . group ( 1 ) . split ( ',' ) for service in services : service_name = service . strip ( ) . strip ( "'" ) modulepath = os . path . split ( filename ) [ 0 ] if ( service_name in modulepath ) : return ( physical_line . find ( service_name ) , 'T107: service tag should not be in path' )
check that a service tag isnt in the module path a service tag should only be added if the service name isnt already in the module path .