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

fix issues with older yaml lib versions

also added missing json import and removed unused ones
This commit is contained in:
Brian Coca 2016-03-03 18:13:36 -05:00
parent 6cad356b3b
commit cc3cb0f65e

View file

@ -21,10 +21,9 @@ __metaclass__ = type
import copy
import os
import stat
import json
import subprocess
from yaml import load, YAMLError
from yaml import YAMLError
from ansible.compat.six import text_type, string_types
from ansible.errors import AnsibleFileNotFound, AnsibleParserError, AnsibleError
@ -145,7 +144,10 @@ class DataLoader():
try:
return loader.get_single_data()
finally:
loader.dispose()
try:
loader.dispose()
except AttributeError:
pass # older versions of yaml don't have dispose function, ignore
def _get_file_contents(self, file_name):
'''