Skip to content

Commit 2125fa3

Browse files
author
Ferry Boender
committed
Remove on-demand yaml import.
1 parent b97ff52 commit 2125fa3

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/ansiblecmdb/ansible.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,19 +151,13 @@ def _parse_hostvar_file(self, hostname, path):
151151

152152
def _parse_groupvar_dir(self, inventory_path):
153153
"""
154-
Parse group_vars dir, if it exists. This requires the yaml module, which
155-
is imported on-demand, since it's not a default module.
154+
Parse group_vars dir, if it exists.
156155
"""
157156
self.log.debug("Parsing group vars (dir): {0}".format(os.path.join(inventory_path, 'group_vars')))
158157
path = os.path.join(os.path.dirname(inventory_path), 'group_vars')
159158
if not os.path.exists(path):
160159
return
161160

162-
try:
163-
import yaml
164-
except ImportError:
165-
import yaml3 as yaml
166-
167161
for (dirpath, dirnames, filenames) in os.walk(path):
168162
for filename in filenames:
169163
f_path = os.path.join(path, filename)

0 commit comments

Comments
 (0)