Skip to content

Commit

Permalink
Merge pull request #8136 from neoaggelos/awxkit-import-yaml-loader
Browse files Browse the repository at this point in the history
Support `!import` and `!include` in `awx import -f yaml` command

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
  • Loading branch information
softwarefactory-project-zuul[bot] committed Sep 15, 2020
2 parents 432e167 + b8cf644 commit 4b72630
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions awxkit/awxkit/cli/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import json
import os

from awxkit import api, config
from awxkit import api, config, yaml_file
from awxkit.exceptions import ImportExportError
from awxkit.utils import to_str
from awxkit.api.pages import Page
Expand Down Expand Up @@ -140,7 +140,7 @@ def handle(self, client, parser):
if fmt == 'json':
data = json.load(client.stdin)
elif fmt == 'yaml':
data = yaml.safe_load(client.stdin)
data = yaml.load(client.stdin, Loader=yaml_file.Loader)
else:
raise ImportExportError("Unsupported format for Import: " + fmt)

Expand Down
1 change: 1 addition & 0 deletions awxkit/test/cli/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def _dummy_authenticate():
- name: Workflow1
"""
)
yaml_fd.name = 'file.yaml'
cli = CLI(stdin=yaml_fd)
cli.parse_args(['--conf.format', 'yaml'])
cli.v2 = MockedV2()
Expand Down

0 comments on commit 4b72630

Please sign in to comment.