Revision 4fe80ef2

b/lib/backend.py
2499 2499
  on the master side.
2500 2500

  
2501 2501
  """
2502
  RE_MASK = re.compile("^[a-zA-Z0-9_-]+$")
2503

  
2504 2502
  def __init__(self, hooks_base_dir=None):
2505 2503
    """Constructor for hooks runner.
2506 2504

  
......
2607 2605
    for relname in dir_contents:
2608 2606
      fname = os.path.join(dir_name, relname)
2609 2607
      if not (os.path.isfile(fname) and os.access(fname, os.X_OK) and
2610
          self.RE_MASK.match(relname) is not None):
2608
              constants.EXT_PLUGIN_MASK.match(relname) is not None):
2611 2609
        rrval = constants.HKR_SKIP
2612 2610
        output = ""
2613 2611
      else:
b/lib/constants.py
21 21

  
22 22
"""Module holding different constants."""
23 23

  
24
import re
25

  
24 26
from ganeti import _autoconf
25 27

  
26 28
# various versions
......
144 146
VALUE_TRUE = "true"
145 147
VALUE_FALSE = "false"
146 148

  
149
# External script validation mask
150
EXT_PLUGIN_MASK = re.compile("^[a-zA-Z0-9_-]+$")
151

  
147 152
# hooks-related constants
148 153
HOOKS_BASE_DIR = _autoconf.SYSCONFDIR + "/ganeti/hooks"
149 154
HOOKS_PHASE_PRE = "pre"

Also available in: Unified diff