Revision f95c81bf lib/utils.py

b/lib/utils.py
1633 1633
  @return: full path to the object if found, None otherwise
1634 1634

  
1635 1635
  """
1636
  # validate the filename mask
1637
  if constants.EXT_PLUGIN_MASK.match(name) is None:
1638
    logging.critical("Invalid value passed for external script name: '%s'",
1639
                     name)
1640
    return None
1641

  
1636 1642
  for dir_name in search_path:
1637 1643
    item_name = os.path.sep.join([dir_name, name])
1638
    if test(item_name):
1644
    # check the user test and that we're indeed resolving to the given
1645
    # basename
1646
    if test(item_name) and os.path.basename(item_name) == name:
1639 1647
      return item_name
1640 1648
  return None
1641 1649

  

Also available in: Unified diff