cli: fix a bug introduced in @ file support

This commit is contained in:
Ryan Petrello 2019-09-03 21:31:46 -04:00
parent ba8b876dd3
commit 70989ca616
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777

View File

@ -6,6 +6,7 @@ import re
import yaml
from distutils.util import strtobool
import six
from .custom import CustomAction
from .format import add_output_formatting_arguments
@ -146,7 +147,7 @@ class ResourceOptionsParser(object):
for k, v in parsed.items():
# add support for file reading at top-level JSON keys
# (to make things like SSH key data easier to work with)
if v.startswith('@'):
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()