def pre_hook(config):
 cmd = config.pre_hook
 if (cmd and (cmd not in pre_hook.already)):
  logger.info('Running pre-hook command: %s', cmd)
  _run_hook(cmd)
  pre_hook.already.add(cmd)
 elif cmd:
  logger.info('Pre-hook command already run, skipping: %s', cmd)

def pre_hook ( config ) : cmd = config . pre_hook if ( cmd and ( cmd not in pre_hook . already ) ) : logger . info ( 'Running pre-hook command: %s' , cmd ) _run_hook ( cmd ) pre_hook . already . add ( cmd ) elif cmd : logger . info ( 'Pre-hook command already run, skipping: %s' , cmd )
run pre-hook if its defined and hasnt been run .