Skip to content

Commit

Permalink
refactored config.runhooks check
Browse files Browse the repository at this point in the history
  • Loading branch information
alonswartz committed Dec 27, 2010
1 parent 2b02cbe commit 0beaac3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ebsmount.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,14 @@ def ebsmount_add(devname, mountdir):
mount(devpath, mountpath, mountoptions)
log(devname, "mounted %s %s (%s)" % (devpath, mountpath, mountoptions))

if config.runhooks and exists(hookspath):
if exists(hookspath):
hooks = os.listdir(hookspath)
hooks.sort()

if hooks and not config.runhooks.lower() == "true":
log(devname, "skipping hooks: RUNHOOKS not set to True")
continue

for file in hooks:
fpath = join(hookspath, file)
if not os.access(fpath, os.X_OK):
Expand Down

0 comments on commit 0beaac3

Please sign in to comment.