Ability to import task lists and handler lists from a top level playbook file. It is possible

to use multiple import statements to implement 'class' like behavior, and also to share
a common list of handlers between multiple patterns.
This commit is contained in:
Michael DeHaan 2012-03-03 10:53:15 -05:00
commit ab408b0000
5 changed files with 62 additions and 8 deletions

View file

@ -165,4 +165,12 @@ def prepare_writeable_dir(tree):
if not os.access(tree, os.W_OK):
exit("Cannot write to path %s" % tree)
def path_dwim(basedir, given):
if given.startswith("/"):
return given
elif given.startswith("~/"):
return os.path.expanduser(given)
else:
return os.path.join(basedir, given)