Skip to content

Commit

Permalink
rule set standard library typo fix (#2824)
Browse files Browse the repository at this point in the history
* rule set standard library typo fix

* back compat and change log

* pr feedback. made correct spelling the actual class not the alias and update changelog.

* double ticks
  • Loading branch information
dlm6693 authored Dec 8, 2022
1 parent 09fba88 commit 0dd3135
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "enhancement",
"category": "Endpoint Provider Standard Library",
"description": "Correct spelling of 'library' in ``StandardLibrary`` class"
}
9 changes: 7 additions & 2 deletions botocore/endpoint_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
STRING_FORMATTER = Formatter()


class RuleSetStandardLibary:
class RuleSetStandardLibrary:
"""Rule actions to be performed by the EndpointProvider."""

def __init__(self, partitions_data):
Expand Down Expand Up @@ -408,6 +408,11 @@ def aws_is_virtual_hostable_s3_bucket(self, value, allow_subdomains):
return self.is_valid_host_label(value, allow_subdomains=False)


# maintains backwards compatibility as `Library` was misspelled
# in earlier versions
RuleSetStandardLibary = RuleSetStandardLibrary


class BaseRule:
"""Base interface for individual endpoint rules."""

Expand Down Expand Up @@ -657,7 +662,7 @@ def __init__(
self.version = version
self.parameters = self._ingest_parameter_spec(parameters)
self.rules = [RuleCreator.create(**rule) for rule in rules]
self.rule_lib = RuleSetStandardLibary(partitions)
self.rule_lib = RuleSetStandardLibrary(partitions)
self.documentation = documentation

def _ingest_parameter_spec(self, parameters):
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_endpoint_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
ErrorRule,
RuleCreator,
RuleSet,
RuleSetStandardLibary,
RuleSetStandardLibrary,
TreeRule,
)
from botocore.exceptions import (
Expand Down Expand Up @@ -95,7 +95,7 @@ def partitions(loader):

@pytest.fixture(scope="module")
def rule_lib(partitions):
return RuleSetStandardLibary(partitions)
return RuleSetStandardLibrary(partitions)


@pytest.fixture(scope="module")
Expand Down

0 comments on commit 0dd3135

Please sign in to comment.