mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
parent
bfb3467d52
commit
e0975602d1
1 changed files with 5 additions and 2 deletions
|
@ -20,7 +20,6 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
import ast
|
||||
import os
|
||||
import random
|
||||
import uuid
|
||||
|
||||
|
@ -120,6 +119,7 @@ def merge_hash(a, b):
|
|||
def load_extra_vars(loader, options):
|
||||
extra_vars = {}
|
||||
for extra_vars_opt in options.extra_vars:
|
||||
data = None
|
||||
extra_vars_opt = to_text(extra_vars_opt, errors='surrogate_or_strict')
|
||||
if extra_vars_opt.startswith(u"@"):
|
||||
# Argument is a YAML file (JSON is a subset of YAML)
|
||||
|
@ -130,7 +130,10 @@ def load_extra_vars(loader, options):
|
|||
else:
|
||||
# Arguments as Key-value
|
||||
data = parse_kv(extra_vars_opt)
|
||||
|
||||
if data is not None:
|
||||
extra_vars = combine_vars(extra_vars, data)
|
||||
|
||||
return extra_vars
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue