Compare 034d5d1 ... +249 ... 41e66df

Showing 18 of 155 files from the diff.
Other files ignored by Codecov
setup.py has changed.
setup.cfg has changed.

@@ -40,17 +40,14 @@
Loading
40 40
from botocore.errorfactory import ClientExceptionsFactory
41 41
from botocore import handlers
42 42
from botocore.hooks import HierarchicalEmitter, first_non_none_response
43 -
from botocore.hooks import EventAliaser
44 43
from botocore.loaders import create_loader
45 44
from botocore.parsers import ResponseParserFactory
46 45
from botocore.regions import EndpointResolver
47 46
from botocore.model import ServiceModel
48 47
from botocore import monitoring
49 48
from botocore import paginate
50 49
from botocore import waiter
51 -
from botocore import retryhandler, translate
52 50
from botocore import utils
53 -
from botocore.utils import EVENT_ALIASES, validate_region_name
54 51
from botocore.compat import MutableMapping
55 52
56 53
@@ -100,10 +97,9 @@
Loading
100 97
101 98
        """
102 99
        if event_hooks is None:
103 -
            self._original_handler = HierarchicalEmitter()
100 +
            self._events = HierarchicalEmitter()
104 101
        else:
105 -
            self._original_handler = event_hooks
106 -
        self._events = EventAliaser(self._original_handler)
102 +
            self._events = event_hooks
107 103
        if include_builtin_handlers:
108 104
            self._register_builtin_handlers(self._events)
109 105
        self.user_agent_name = 'Botocore'
@@ -475,49 +471,40 @@
Loading
475 471
        """
476 472
        return self.get_component('data_loader').load_data(data_path)
477 473
478 -
    def get_service_model(self, service_name, api_version=None):
474 +
    def get_service_model(self, service_name):
479 475
        """Get the service model object.
480 476
481 477
        :type service_name: string
482 478
        :param service_name: The service name
483 479
484 -
        :type api_version: string
485 -
        :param api_version: The API version of the service.  If none is
486 -
            provided, then the latest API version will be used.
487 -
488 480
        :rtype: L{botocore.model.ServiceModel}
489 481
        :return: The botocore service model for the service.
490 482
491 483
        """
492 -
        service_description = self.get_service_data(service_name, api_version)
484 +
        service_description = self.get_service_data(service_name)
493 485
        return ServiceModel(service_description, service_name=service_name)
494 486
495 -
    def get_waiter_model(self, service_name, api_version=None):
487 +
    def get_waiter_model(self, service_name):
496 488
        loader = self.get_component('data_loader')
497 489
        waiter_config = loader.load_service_model(
498 -
            service_name, 'waiters-2', api_version)
490 +
            service_name, 'waiters-2')
499 491
        return waiter.WaiterModel(waiter_config)
500 492
501 -
    def get_paginator_model(self, service_name, api_version=None):
493 +
    def get_paginator_model(self, service_name):
502 494
        loader = self.get_component('data_loader')
503 495
        paginator_config = loader.load_service_model(
504 -
            service_name, 'paginators-1', api_version)
496 +
            service_name, 'paginators-1')
505 497
        return paginate.PaginatorModel(paginator_config)
506 498
507 -
    def get_service_data(self, service_name, api_version=None):
499 +
    def get_service_data(self, service_name):
508 500
        """
509 501
        Retrieve the fully merged data associated with a service.
510 502
        """
511 503
        data_path = service_name
512 504
        service_data = self.get_component('data_loader').load_service_model(
513 505
            data_path,
514 506
            type_name='service-2',
515 -
            api_version=api_version
516 507
        )
517 -
        service_id = EVENT_ALIASES.get(service_name, service_name)
518 -
        self._events.emit('service-data-loaded.%s' % service_id,
519 -
                          service_data=service_data,
520 -
                          service_name=service_name, session=self)
521 508
        return service_data
522 509
523 510
    def get_available_services(self):
@@ -711,7 +698,7 @@
Loading
711 698
    def lazy_register_component(self, name, component):
712 699
        self._components.lazy_register_component(name, component)
713 700
714 -
    def create_client(self, service_name, region_name=None, api_version=None,
701 +
    def create_client(self, service_name, region_name=None,
715 702
                      use_ssl=True, verify=None, endpoint_url=None,
716 703
                      aws_access_key_id=None, aws_secret_access_key=None,
717 704
                      aws_session_token=None, config=None):
@@ -726,12 +713,6 @@
Loading
726 713
        :param region_name: The name of the region associated with the client.
727 714
            A client is associated with a single region.
728 715
729 -
        :type api_version: string
730 -
        :param api_version: The API version to use.  By default, botocore will
731 -
            use the latest API version when creating a client.  You only need
732 -
            to specify this parameter if you want to use a previous API version
733 -
            of the client.
734 -
735 716
        :type use_ssl: boolean
736 717
        :param use_ssl: Whether or not to use SSL.  By default, SSL is used.
737 718
            Note that not all services support non-ssl connections.
@@ -801,10 +782,6 @@
Loading
801 782
        if verify is None:
802 783
            verify = self.get_config_variable('ca_bundle')
803 784
804 -
        if api_version is None:
805 -
            api_version = self.get_config_variable('api_versions').get(
806 -
                service_name, None)
807 -
808 785
        loader = self.get_component('data_loader')
809 786
        event_emitter = self.get_component('event_emitter')
810 787
        response_parser_factory = self.get_component(
@@ -829,13 +806,12 @@
Loading
829 806
        config_store = self.get_component('config_store')
830 807
        client_creator = botocore.client.ClientCreator(
831 808
            loader, endpoint_resolver, self.user_agent(), event_emitter,
832 -
            retryhandler, translate, response_parser_factory,
833 -
            exceptions_factory, config_store)
809 +
            response_parser_factory, exceptions_factory, config_store)
834 810
        client = client_creator.create_client(
835 811
            service_name=service_name, region_name=region_name,
836 812
            is_secure=use_ssl, endpoint_url=endpoint_url, verify=verify,
837 813
            credentials=credentials, scoped_config=self.get_scoped_config(),
838 -
            client_config=config, api_version=api_version)
814 +
            client_config=config)
839 815
        monitor = self._get_internal_component('monitor')
840 816
        if monitor is not None:
841 817
            monitor.register(client.meta.events)
@@ -850,7 +826,7 @@
Loading
850 826
            else:
851 827
                region_name = self.get_config_variable('region')
852 828
853 -
        validate_region_name(region_name)
829 +
        utils.validate_region_name(region_name)
854 830
        # For any client that we create in retrieving credentials
855 831
        # we want to create it using the same region as specified in
856 832
        # creating this client. It is important to note though that the

@@ -532,32 +532,15 @@
Loading
532 532
    """Error when invalid retry configuration is specified"""
533 533
    fmt = (
534 534
        'Value provided to "max_attempts": {provided_max_attempts} must '
535 -
        'be an integer greater than or equal to {min_value}.'
535 +
        'be an integer greater than or equal to one.'
536 536
    )
537 537
538 538
539 539
class InvalidRetryModeError(InvalidRetryConfigurationError):
540 540
    """Error when invalid retry mode configuration is specified"""
541 541
    fmt = (
542 542
        'Invalid value provided to "mode": "{provided_retry_mode}" must '
543 -
        'be one of: "legacy", "standard", "adaptive"'
544 -
    )
545 -
546 -
547 -
class InvalidS3UsEast1RegionalEndpointConfigError(BotoCoreError):
548 -
    """Error for invalid s3 us-east-1 regional endpoints configuration"""
549 -
    fmt = (
550 -
        'S3 us-east-1 regional endpoint option '
551 -
        '{s3_us_east_1_regional_endpoint_config} is '
552 -
        'invalid. Valid options are: "legacy", "regional"'
553 -
    )
554 -
555 -
556 -
class InvalidSTSRegionalEndpointsConfigError(BotoCoreError):
557 -
    """Error when invalid sts regional endpoints configuration is specified"""
558 -
    fmt = (
559 -
        'STS regional endpoints option {sts_regional_endpoints_config} is '
560 -
        'invalid. Valid options are: "legacy", "regional"'
543 +
        'be one of: "standard" or "adaptive"'
561 544
    )
562 545
563 546
@@ -617,6 +600,13 @@
Loading
617 600
    fmt = "An unspecified error happened when resolving SSO credentials"
618 601
619 602
603 +
class PendingAuthorizationExpiredError(SSOError):
604 +
    fmt = (
605 +
        "The pending authorization to retrieve an SSO token has expired. The "
606 +
        "device authorization flow to retrieve an SSO token must be restarted."
607 +
    )
608 +
609 +
620 610
class SSOTokenLoadError(SSOError):
621 611
    fmt = "Error loading SSO Token: {error_msg}"
622 612

@@ -165,7 +165,7 @@
Loading
165 165
166 166
    def __init__(self, client):
167 167
        self._client = client
168 -
        self._service_name = self._client.meta.service_model.service_name
168 +
        self._service_id = self._client.meta.service_model.service_id
169 169
170 170
    def document_exceptions(self, section):
171 171
        self._add_title(section)
@@ -269,7 +269,7 @@
Loading
269 269
        example_section.style.bold('Syntax')
270 270
        example_section.style.new_paragraph()
271 271
        documenter = ResponseExampleDocumenter(
272 -
            service_name=self._service_name,
272 +
            service_id=self._service_id,
273 273
            operation_name=None,
274 274
            event_emitter=self._client.meta.events,
275 275
        )
@@ -283,7 +283,7 @@
Loading
283 283
        params_section.style.bold('Structure')
284 284
        params_section.style.new_paragraph()
285 285
        documenter = ResponseParamsDocumenter(
286 -
            service_name=self._service_name,
286 +
            service_id=self._service_id,
287 287
            operation_name=None,
288 288
            event_emitter=self._client.meta.events,
289 289
        )

@@ -22,9 +22,9 @@
Loading
22 22
class ShapeDocumenter(object):
23 23
    EVENT_NAME = ''
24 24
25 -
    def __init__(self, service_name, operation_name, event_emitter,
25 +
    def __init__(self, service_id, operation_name, event_emitter,
26 26
                 context=None):
27 -
        self._service_name = service_name
27 +
        self._service_id = service_id
28 28
        self._operation_name = operation_name
29 29
        self._event_emitter = event_emitter
30 30
        self._context = context
@@ -75,15 +75,15 @@
Loading
75 75
            if is_top_level_param:
76 76
                self._event_emitter.emit(
77 77
                    'docs.%s.%s.%s.%s' % (self.EVENT_NAME,
78 -
                                          self._service_name,
78 +
                                          self._service_id,
79 79
                                          self._operation_name,
80 80
                                          name),
81 81
                    section=section)
82 82
            at_overlying_method_section = (len(history) == 1)
83 83
            if at_overlying_method_section:
84 84
                self._event_emitter.emit(
85 85
                    'docs.%s.%s.%s.complete-section' % (self.EVENT_NAME,
86 -
                                                        self._service_name,
86 +
                                                        self._service_id,
87 87
                                                        self._operation_name),
88 88
                    section=section)
89 89
            history.pop()

@@ -566,7 +566,7 @@
Loading
566 566
    http_method = HttpMethod
567 567
    context = {
568 568
        'is_presign_request': True,
569 -
        'use_global_endpoint': _should_use_global_endpoint(self),
569 +
        'use_global_endpoint': False,
570 570
    }
571 571
572 572
    request_signer = self._request_signer
@@ -699,7 +699,7 @@
Loading
699 699
        request_dict, endpoint_url=self.meta.endpoint_url,
700 700
        context={
701 701
            'is_presign_request': True,
702 -
            'use_global_endpoint': _should_use_global_endpoint(self),
702 +
            'use_global_endpoint': False,
703 703
        },
704 704
    )
705 705
@@ -719,16 +719,3 @@
Loading
719 719
    return post_presigner.generate_presigned_post(
720 720
        request_dict=request_dict, fields=fields, conditions=conditions,
721 721
        expires_in=expires_in)
722 -
723 -
724 -
def _should_use_global_endpoint(client):
725 -
    if client.meta.partition != 'aws':
726 -
        return False
727 -
    s3_config = client.meta.config.s3
728 -
    if s3_config:
729 -
        if s3_config.get('use_dualstack_endpoint', False):
730 -
            return False
731 -
        if s3_config.get('us_east_1_regional_endpoint') == 'regional' and \
732 -
                client.meta.config.region_name == 'us-east-1':
733 -
            return False
734 -
    return True

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Learn more Showing 5 files with coverage changes found.

Changes in botocore/compat.py
-47
+47
Loading file...
Changes in botocore/handlers.py
-6
+6
Loading file...
Changes in botocore/hooks.py
-2
+2
Loading file...
Changes in botocore/awsrequest.py
-1
+1
Loading file...
Changes in botocore/utils.py
-1
+1
Loading file...

251 Commits

+1
-1
+2
+4
-2
-1
+1
+1
-1
-1
+1
+1
-1
+3
+2
+1
+1
-1
+2
-2
-1
+1
+1
-1
-1
+1
+1
-1
-1
+1
Hiding 1 contexual commits
+9
+13
-4
Hiding 2 contexual commits Hiding 2 contexual commits
-1
+1
+37
+34
+3
+1
-1
+134
+135
-1
-134
-135
+1
-1
+1
+1
-1
+250
+238
+12
-43
+43
Hiding 1 contexual commits
+1
-1
-2 Files
-453
+133
-586
-134
-134
Hiding 1 contexual commits
+1
-1
-1
+1
+134
+134
-134
-134
+1
-1
-4
+4
+4
-4
-1
+1
-3
+3
+3
-3
+29
+29
-1
+1
-1
+1
+10
+9
+1
+1
-1
-1
+1
+43
-43
-43
+43
+3
+3
+133
+130
+3
-133
-130
-3
-3
+3
+3
-3
-3
+3
+46
-46
-46
+46
+3
-3
+1
-1
+41
-41
-42
+42
-3
+3
+4
-4
+42
-42
-43
+43
+133
+133
-133
-133
-3
+3
+4
-4
-4
+4
+3
-3
+5
+5
Hiding 1 contexual commits
Hiding 1 contexual commits
+1
-1
-1
+1
Hiding 1 contexual commits
-3
+3
Hiding 1 contexual commits
+3
-3
Hiding 1 contexual commits Hiding 2 contexual commits
+42
-42
Hiding 1 contexual commits
-42
+42
Hiding 2 contexual commits
+11
+11
Hiding 2 contexual commits
+1
+1
Hiding 1 contexual commits
Hiding 2 contexual commits Hiding 1 contexual commits
+131
+128
+3
-131
-131
Hiding 1 contexual commits
+3
-3
Hiding 3 contexual commits
+11
+11
Hiding 1 contexual commits
-1
+1
Hiding 3 contexual commits
+183
+180
+3
Hiding 1 contexual commits
Hiding 1 contexual commits
Hiding 1 contexual commits
Hiding 1 contexual commits Hiding 1 contexual commits
Hiding 2 contexual commits
+128
+128
Hiding 2 contexual commits
-115
-117
+2
Hiding 1 contexual commits
Hiding 1 contexual commits