Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions awscli/customizations/configure/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,9 @@ def _run_main(self, args, parsed_globals):
self._stream.write('\n')
return 0
elif isinstance(value, dict):
# TODO: add support for this. We would need to print it off in
# the same format as the config file.
self._error_stream.write(
'varname (%s) must reference a value, not a section or '
'sub-section.' % varname
)
return 1
for key, val in value.items():
self._stream.write('%s = %s\n' % (key, val))
return 0
else:
return 1

Expand Down
11 changes: 3 additions & 8 deletions tests/unit/customizations/configure/test_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,9 @@ def test_get_section_returns_error(self):
session.config = {'s3': {'signature_version': 's3v4'}}
stream, error_stream, config_get = self.create_command(session)
rc = config_get(args=['s3'], parsed_globals=None)
self.assertEqual(rc, 1)

error_message = error_stream.getvalue()
expected_message = (
'varname (s3) must reference a value, not a section or '
'sub-section.')
self.assertEqual(error_message, expected_message)
self.assertEqual(stream.getvalue(), '')
self.assertEqual(rc, 0)
self.assertEqual(stream.getvalue(), 'signature_version = s3v4\n')
self.assertEqual(error_stream.getvalue(), '')

def test_get_non_string_returns_error(self):
# This should never happen, but we handle this case so we should
Expand Down