mirror of
https://github.com/ansible/awx.git
synced 2026-01-09 23:12:08 -03:30
minor cleanup up CLI import -f yaml support
This commit is contained in:
parent
579604d2c6
commit
987c7d48a0
@ -136,13 +136,13 @@ class Import(CustomCommand):
|
||||
parser.print_help()
|
||||
raise SystemExit()
|
||||
|
||||
format = getattr(client.args, 'conf.format')
|
||||
if format == 'json':
|
||||
fmt = client.get_config('format')
|
||||
if fmt == 'json':
|
||||
data = json.load(client.stdin)
|
||||
elif format == 'yaml':
|
||||
elif fmt == 'yaml':
|
||||
data = yaml.safe_load(client.stdin)
|
||||
else:
|
||||
raise ImportExportError("Unsupported format for Import: " + format)
|
||||
raise ImportExportError("Unsupported format for Import: " + fmt)
|
||||
|
||||
client.authenticate()
|
||||
client.v2.import_assets(data)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user