Skip to content

Commit 46f73d2

Browse files
author
yanghaiying
committed
fix: deprecation of yaml.load method, change to yaml.full_load
1 parent 7a7548b commit 46f73d2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ansible_api/controller.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ async def post(self, request):
145145
if os.path.isfile(yml_file):
146146
task_list = []
147147
with open(yml_file, 'r') as contents:
148-
yaml_cnt = yaml.load(contents)
148+
# yaml_cnt = yaml.load(contents)
149+
yaml_cnt = yaml.full_load(contents)
149150
if len(yaml_cnt) > 0 and len(yaml_cnt[0].get('tasks', [])) > 0:
150151
task_list = [x.get('name', 'unnamed') for x in yaml_cnt[0]['tasks']]
151152
Tool.LOGGER.info("playbook: {0}, host: {1}".format(yml_file, hosts))

0 commit comments

Comments
 (0)