1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Check against None around playbook basedir

This commit is contained in:
Michael DeHaan 2013-08-01 20:44:19 -04:00
parent 16d25f4115
commit 0335d05f43

View file

@ -40,7 +40,10 @@ class VarsModule(object):
""" main body of the plugin, does actual loading """
inventory = self.inventory
self.pb_basedir = os.path.abspath(inventory.playbook_basedir())
basedir = inventory.playbook_basedir()
if basedir is not None:
basedir = os.path.abspath(basedir)
self.pb_basedir = basedir
# sort groups by depth so deepest groups can override the less deep ones
groupz = sorted(inventory.groups_for_host(host.name), key=lambda g: g.depth)