mirror of
https://github.com/ansible/awx.git
synced 2026-03-26 13:25:02 -02:30
Merge pull request #4881 from ryanpetrello/cli-ssh-example
cli: warn users if they specify a missing file with @
Reviewed-by: Yanis Guenane
https://github.com/Spredzy
This commit is contained in:
@@ -57,5 +57,5 @@ Importing an SSH Key
|
|||||||
|
|
||||||
awx credentials create --credential_type 'Machine' \
|
awx credentials create --credential_type 'Machine' \
|
||||||
--name 'My SSH Key' --user 'alice' \
|
--name 'My SSH Key' --user 'alice' \
|
||||||
--inputs "{'username': 'server-login', 'ssh_key_data': '@~/.ssh/id_rsa`}"
|
--inputs '{"username": "server-login", "ssh_key_data": "@~/.ssh/id_rsa"}'
|
||||||
|
|
||||||
|
|||||||
@@ -165,8 +165,7 @@ class ResourceOptionsParser(object):
|
|||||||
# (to make things like SSH key data easier to work with)
|
# (to make things like SSH key data easier to work with)
|
||||||
if isinstance(v, six.text_type) and v.startswith('@'):
|
if isinstance(v, six.text_type) and v.startswith('@'):
|
||||||
path = os.path.expanduser(v[1:])
|
path = os.path.expanduser(v[1:])
|
||||||
if os.path.exists(path):
|
parsed[k] = open(path).read()
|
||||||
parsed[k] = open(path).read()
|
|
||||||
|
|
||||||
return parsed
|
return parsed
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user