mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 01:57:35 -03:30
cli: warn users if they specify a missing file with @
This commit is contained in:
parent
1f62d223a2
commit
6c1488ed00
@ -57,5 +57,5 @@ Importing an SSH Key
|
||||
|
||||
awx credentials create --credential_type 'Machine' \
|
||||
--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)
|
||||
if isinstance(v, six.text_type) and v.startswith('@'):
|
||||
path = os.path.expanduser(v[1:])
|
||||
if os.path.exists(path):
|
||||
parsed[k] = open(path).read()
|
||||
parsed[k] = open(path).read()
|
||||
|
||||
return parsed
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user