Skip to content

Commit

Permalink
Merge branch 'release-1.2.6'
Browse files Browse the repository at this point in the history
* release-1.2.6: (37 commits)
  Bumping version to 1.2.6
  Bump bcdoc version
  Update changelog with latest features
  Update changelog with configure list PR
  Correct grammar/typos in comments
  Added create-environment example for elastic beanstalk
  Updated examples from the doc team
  Add docs for the aws configure list command
  Add an 'aws configure list' command
  Remove unused function
  Update ec2 modify-instance-attribute example
  Notify user when broken symlinks are encountered
  Add issue 484 to changelog
  Only document the simpler shorthand syntax
  Fix infinite loop in python3
  Pull up structure(scalar) bools into top level args
  Add more shorthand syntax support
  If we are constructing a NetworkInterfaces structure for the user in run-instances, we need to make sure that any security groups specified via --security-group-ids are moved into the NetworkInterfaces structure.  Otherwise we get a client error from EC2.  Fixes #504.
  Update changelog to add issue 501
  Add entry to changelog for fix
  ...
  • Loading branch information
jamesls committed Nov 26, 2013
2 parents 7f8b88b + 924d065 commit 762b925
Show file tree
Hide file tree
Showing 40 changed files with 1,454 additions and 145 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@
CHANGELOG
=========

1.2.6
=====

* Allow ``--endpoint-url`` to work with the ``aws s3`` command
(`issue 469 <https://github.com/aws/aws-cli/pull/469>`__)
* Fix issue with ``aws cloudtrail [create|update]-subscription`` not
honoring the ``--profile`` argument
(`issue 494 <https://github.com/aws/aws-cli/issues/494>`__)
* Fix issue with ``--associate-public-ip-address`` when a ``--subnet-id``
is provided (`issue 501 <https://github.com/aws/aws-cli/issues/501>`__)
* Don't require key names for structures of single scalar values
(`issue 484 <https://github.com/aws/aws-cli/issues/484>`__)
* Fix issue with symlinks silently failing during ``s3 sync/cp``
(`issue 425 <https://github.com/aws/aws-cli/issues/425>`__
and `issue 487 <https://github.com/aws/aws-cli/issues/487>`__)
* Add a ``aws configure list`` command to show where the configuration
values are sourced from
(`issue 513 <https://github.com/aws/aws-cli/pull/513>`__)
* Update ``cloudwatch`` command to use Signature Version 4
* Update ``ec2`` command to support enhanced network capabilities and
pagination controls for ``describe-instances`` and ``describe-tags``
* Add support in ``rds`` command for copying DB snapshots from
one AWS region to another


1.2.5
=====

Expand Down
8 changes: 7 additions & 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.2.5'
__version__ = '1.2.6'

#
# Get our data path to be added to botocore's search path
Expand All @@ -39,3 +39,9 @@
'data_path': ('data_path', 'AWS_DATA_PATH', None),
'output': ('output', 'AWS_DEFAULT_OUTPUT', 'json'),
}

SCALAR_TYPES = set([
'string', 'float', 'integer', 'long', 'boolean', 'double',
'blob', 'timestamp'
])
COMPLEX_TYPES = set(['structure', 'map', 'list'])
14 changes: 11 additions & 3 deletions awscli/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,26 @@ class ArgTableArgParser(CLIArgParser):
"""CLI arg parser based on an argument table."""
Usage = ("aws [options] <command> <subcommand> [parameters]")

def __init__(self, argument_table):
def __init__(self, argument_table, command_table=None):
# command_table is an optional subcommand_table. If it's passed
# in, then we'll update the argparse to parse a 'subcommand' argument
# and populate the choices field with the command table keys.
super(ArgTableArgParser, self).__init__(
formatter_class=self.Formatter,
add_help=False,
usage=self.Usage,
conflict_handler='resolve')
self._build(argument_table)
if command_table is None:
command_table = {}
self._build(argument_table, command_table)

def _build(self, argument_table):
def _build(self, argument_table, command_table):
for arg_name in argument_table:
argument = argument_table[arg_name]
argument.add_to_parser(self)
if command_table:
self.add_argument('subcommand', choices=list(command_table.keys()),
nargs='?')

def parse_known_args(self, args, namespace=None):
if len(args) == 1 and args[0] == 'help':
Expand Down
30 changes: 25 additions & 5 deletions awscli/argprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@
import six

from awscli import utils
from awscli import SCALAR_TYPES, COMPLEX_TYPES


SCALAR_TYPES = set([
'string', 'float', 'integer', 'long', 'boolean', 'double',
'blob', 'timestamp'
])
COMPLEX_TYPES = set(['structure', 'map', 'list'])
LOG = logging.getLogger('awscli.argprocess')


Expand Down Expand Up @@ -85,6 +81,7 @@ class ParamShorthand(object):

SHORTHAND_SHAPES = {
'structure(scalars)': '_key_value_parse',
'structure(scalar)': '_special_key_value_parse',
'map-scalar': '_key_value_parse',
'list-structure(scalar)': '_list_scalar_parse',
'list-structure(scalars)': '_list_key_value_parse',
Expand Down Expand Up @@ -226,6 +223,20 @@ def _list_key_value_parse(self, param, value):
parsed.append(single_struct_param)
return parsed

def _special_key_value_parse(self, param, value):
# This is a special key value parse that can do the normal
# key=value parsing, *but* supports a few additional conveniences
# when working with a structure with a single element.
# Precondition: param is a shape of structure(scalar)
if len(param.members) == 1 and param.members[0].name == 'Value' and \
'=' not in value:
# We have an even shorter shorthand syntax for structure
# of scalars of a single element with a member name of
# 'Value'.
return {'Value': value}
else:
return self._key_value_parse(param, value)

def _key_value_parse(self, param, value):
# The expected structure is:
# key=value,key2=value
Expand Down Expand Up @@ -283,6 +294,15 @@ def _docs_list_key_value_parse(self, param):
for sub_param in param.members.members])
return s

def _docs_special_key_value_parse(self, param):
if len(param.members) == 1 and param.members[0].name == 'Value':
# Returning None will indicate that we don't have
# any examples to generate, and the entire examples section
# should be skipped for this arg.
return None
else:
self._docs_key_value_parse(param)

def _docs_key_value_parse(self, param):
s = '%s ' % param.cli_name
if param.type == 'structure':
Expand Down
6 changes: 4 additions & 2 deletions awscli/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,8 @@ class BooleanArgument(CLIArgument):
"""

def __init__(self, name, argument_object, operation_object,
action='store_true', dest=None, group_name=None):
action='store_true', dest=None, group_name=None,
default=None):
super(BooleanArgument, self).__init__(name, argument_object,
operation_object)
self._mutex_group = None
Expand All @@ -416,6 +417,7 @@ def __init__(self, name, argument_object, operation_object,
self._group_name = self.name
else:
self._group_name = group_name
self._default = default

def add_to_params(self, parameters, value):
# If a value was explicitly specified (so value is True/False
Expand Down Expand Up @@ -445,7 +447,7 @@ def add_to_parser(self, parser):
parser.add_argument(self.cli_name,
help=self.documentation,
action=self._action,
default=None,
default=self._default,
dest=self._destination)

@property
Expand Down
Loading

0 comments on commit 762b925

Please sign in to comment.