Skip to content

Commit

Permalink
Merge branch 'release-1.7.11'
Browse files Browse the repository at this point in the history
* release-1.7.11:
  Bumping version to 1.7.11
  Update changelog
  Update changelog with sts bug fix
  Update linege unit tests
  Shortened ``lineage_names`` code
  Add ``lineage_names`` to commands
  Fix a changelog entry format
  • Loading branch information
AWS committed Feb 19, 2015
2 parents 078d1ca + e99d237 commit 6d7e89c
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 11 deletions.
14 changes: 12 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@
CHANGELOG
=========

1.7.11
======

* bugfix:``aws sts``: Allow calling ``assume-role-with-saml`` without
credentials.
* bugfix:``aws sts``: Allow users to make regionalized STS calls by specifying
the STS endpoint with ``--endpoint-url`` and the region with ``--region``.
(`botocore issue 464 <https://github.com/boto/botocore/pull/464>`__)


1.7.10
======

* bugfix:``aws sts``: Fix regression where if a region was not activated for STS it would
raise an error if call was made to that region..
* bugfix:``aws sts``: Fix regression where if a region was not activated for
STS it would raise an error if call was made to that region.


1.7.9
Expand Down
2 changes: 1 addition & 1 deletion awscli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"""
import os

__version__ = '1.7.10'
__version__ = '1.7.11'

#
# Get our data path to be added to botocore's search path
Expand Down
10 changes: 10 additions & 0 deletions awscli/clidriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@ def lineage(self):
# a list.
return [self]

@property
def lineage_names(self):
# Represents the lineage of a command in terms of command ``name``
return [cmd.name for cmd in self.lineage]

def __call__(self, args, parsed_globals):
"""Invoke CLI operation.
Expand Down Expand Up @@ -474,6 +479,11 @@ def lineage(self):
def lineage(self, value):
self._lineage = value

@property
def lineage_names(self):
# Represents the lineage of a command in terms of command ``name``
return [cmd.name for cmd in self.lineage]

@property
def arg_table(self):
if self._arg_table is None:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
# The short X.Y version.
version = '1.7.'
# The full version, including alpha/beta/rc tags.
release = '1.7.10'
release = '1.7.11'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import awscli


requires = ['botocore>=0.91.0,<0.92.0',
requires = ['botocore>=0.92.0,<0.93.0',
'bcdoc>=0.12.0,<0.13.0',
'colorama==0.2.5',
'docutils>=0.10',
Expand Down
7 changes: 6 additions & 1 deletion tests/integration/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,14 @@ def assert_lineage_names(self, ref_lineage_names):
actual_lineage_names = []
for cmd in command.lineage:
actual_lineage_names.append(cmd.name)


# Assert the actual names of each command in a lineage is as expected.
self.assertEqual(actual_lineage_names, ref_lineage_names)

# Assert that ``lineage_names`` for each command is in sync with what
# is actually in the command's ``lineage``.
self.assertEqual(command.lineage_names, actual_lineage_names)

def test_service_level_commands(self):
# Check a normal unchanged service command
self.assert_lineage_names(['ec2'])
Expand Down
8 changes: 7 additions & 1 deletion tests/unit/customizations/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def test_load_subcommand_table_property(self):

def test_load_lineage(self):
self.assertEqual(self.command.lineage, [self.command])
self.assertEqual(self.command.lineage_names, [self.command.name])

def test_pass_lineage_to_child_command(self):
class MockCustomCommand(BasicCommand):
Expand All @@ -66,7 +67,12 @@ class MockCustomCommand(BasicCommand):
SUBCOMMANDS = [{'name': 'basic', 'command_class': BasicCommand}]

self.command = MockCustomCommand(self.session)
lineage = self.command.subcommand_table['basic'].lineage
subcommand = self.command.subcommand_table['basic']
lineage = subcommand.lineage
self.assertEqual(len(lineage), 2)
self.assertEqual(lineage[0], self.command)
self.assertIsInstance(lineage[1], BasicCommand)
self.assertEqual(
subcommand.lineage_names,
[self.command.name, subcommand.name]
)
21 changes: 17 additions & 4 deletions tests/unit/test_clidriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,10 @@ def test_name(self):
def test_lineage(self):
self.assertEqual(self.cmd.lineage, [self.cmd])

def test_lineage_names(self):
with self.assertRaises(NotImplementedError):
self.cmd.lineage_names

def test_arg_table(self):
self.assertEqual(self.cmd.arg_table, {})

Expand All @@ -744,9 +748,13 @@ def test_name(self):
self.assertEqual(self.cmd.name, 'bar')

def test_lineage(self):
cmd = CLICommand()
self.assertEqual(self.cmd.lineage, [self.cmd])
self.cmd.lineage = ['foo']
self.assertEqual(self.cmd.lineage, ['foo'])
self.cmd.lineage = [cmd]
self.assertEqual(self.cmd.lineage, [cmd])

def test_lineage_names(self):
self.assertEqual(self.cmd.lineage_names, ['foo'])

def test_pass_lineage_to_child(self):
# In order to introspect the service command's subcommands
Expand All @@ -756,6 +764,7 @@ def test_pass_lineage_to_child(self):
child_cmd = help_command.command_table['list-objects']
self.assertEqual(child_cmd.lineage,
[self.cmd, child_cmd])
self.assertEqual(child_cmd.lineage_names, ['foo', 'list-objects'])


class TestServiceOperation(unittest.TestCase):
Expand All @@ -769,9 +778,13 @@ def test_name(self):
self.assertEqual(self.cmd.name, 'bar')

def test_lineage(self):
cmd = CLICommand()
self.assertEqual(self.cmd.lineage, [self.cmd])
self.cmd.lineage = ['foo']
self.assertEqual(self.cmd.lineage, ['foo'])
self.cmd.lineage = [cmd]
self.assertEqual(self.cmd.lineage, [cmd])

def test_lineage_names(self):
self.assertEqual(self.cmd.lineage_names, ['foo'])


if __name__ == '__main__':
Expand Down

0 comments on commit 6d7e89c

Please sign in to comment.