Skip to content

Commit

Permalink
Merge pull request #1977 from aws/revert-1971-ec2-pagination
Browse files Browse the repository at this point in the history
Revert "Default ec2 page size to 1000"
  • Loading branch information
kyleknap committed May 18, 2016
2 parents 10e42d3 + 1228672 commit 7de81ca
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 119 deletions.
27 changes: 0 additions & 27 deletions awscli/customizations/ec2/paginate.py

This file was deleted.

2 changes: 0 additions & 2 deletions awscli/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
from awscli.customizations.ec2.protocolarg import register_protocol_args
from awscli.customizations.ec2.runinstances import register_runinstances
from awscli.customizations.ec2.secgroupsimplify import register_secgroup
from awscli.customizations.ec2.paginate import set_max_results_default
from awscli.customizations.ecr import register_ecr_commands
from awscli.customizations.emr.emr import emr_initialize
from awscli.customizations.gamelift import register_gamelift_commands
Expand Down Expand Up @@ -103,7 +102,6 @@ def awscli_initialize(event_handlers):
ec2_add_priv_launch_key)
register_parse_global_args(event_handlers)
register_pagination(event_handlers)
event_handlers.register('operation-args-parsed.ec2.*', set_max_results_default)
register_secgroup(event_handlers)
register_bundleinstance(event_handlers)
s3_plugin_initialize(event_handlers)
Expand Down
28 changes: 4 additions & 24 deletions tests/functional/ec2/test_describe_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from awscli.customizations.ec2.paginate import DEFAULT_MAX_RESULTS
from awscli.testutils import BaseAWSCommandParamsTest


Expand All @@ -21,35 +20,26 @@ class TestDescribeInstances(BaseAWSCommandParamsTest):

def test_no_params(self):
cmdline = self.prefix
result = {'MaxResults': DEFAULT_MAX_RESULTS}
result = {}
self.assert_params_for_cmd(cmdline, result)

def test_instance_id(self):
args = ' --instance-ids i-12345678'
cmdline = self.prefix + args
result = {
'InstanceIds': ['i-12345678'],
'MaxResults': DEFAULT_MAX_RESULTS
}
result = {'InstanceIds': ['i-12345678']}
self.assert_params_for_cmd(cmdline, result)

def test_instance_ids(self):
args = ' --instance-ids i-12345678 i-87654321'
cmdline = self.prefix + args
result = {
'InstanceIds': ['i-12345678', 'i-87654321'],
'MaxResults': DEFAULT_MAX_RESULTS
}
result = {'InstanceIds': ['i-12345678', 'i-87654321']}
self.assert_params_for_cmd(cmdline, result)

def test_instance_ids_alternate(self):
# Not required, but will still work if you use JSON.
args = ' --instance-ids ["i-12345678","i-87654321"]'
cmdline = self.prefix + args
result = {
'InstanceIds': ['i-12345678', 'i-87654321'],
'MaxResults': DEFAULT_MAX_RESULTS
}
result = {'InstanceIds': ['i-12345678', 'i-87654321']}
self.assert_params_for_cmd(cmdline, result)

def test_filter_json(self):
Expand All @@ -60,7 +50,6 @@ def test_filter_json(self):
{'Name': 'group-name',
'Values': ['foobar']},
],
'MaxResults': DEFAULT_MAX_RESULTS
}
self.assert_params_for_cmd(cmdline, result)

Expand All @@ -72,7 +61,6 @@ def test_filter_simple(self):
{'Name': 'group-name',
'Values': ['foobar']},
],
'MaxResults': DEFAULT_MAX_RESULTS
}
self.assert_params_for_cmd(cmdline, result)

Expand All @@ -84,7 +72,6 @@ def test_filter_values(self):
{'Name': 'group-name',
'Values': ['foobar', 'fiebaz']},
],
'MaxResults': DEFAULT_MAX_RESULTS
}
self.assert_params_for_cmd(cmdline, result)

Expand All @@ -99,7 +86,6 @@ def test_multiple_filters(self):
{'Name': 'instance-id',
'Values': ['i-12345']},
],
'MaxResults': DEFAULT_MAX_RESULTS
}
self.assert_params_for_cmd(cmdline, result)

Expand All @@ -115,7 +101,6 @@ def test_multiple_filters_alternate(self):
{'Name': 'instance-id',
'Values': ['i-12345']},
],
'MaxResults': DEFAULT_MAX_RESULTS
}
self.assert_params_for_cmd(cmdlist, result)

Expand All @@ -125,11 +110,6 @@ def test_page_size(self):
result = {'MaxResults': 10}
self.assert_params_for_cmd(cmdline, result)

def test_page_size_default(self):
cmdline = self.prefix
result = {'MaxResults': DEFAULT_MAX_RESULTS}
self.assert_params_for_cmd(cmdline, result)


if __name__ == "__main__":
unittest.main()
12 changes: 0 additions & 12 deletions tests/unit/customizations/ec2/__init__.py

This file was deleted.

54 changes: 0 additions & 54 deletions tests/unit/customizations/ec2/test_paginate.py

This file was deleted.

0 comments on commit 7de81ca

Please sign in to comment.