MCPcopy Index your code
hub / github.com/aws/aws-cli / extract_region

Method extract_region

awscli/customizations/codecommit.py:144–154  ·  view source on GitHub ↗
(self, parameters, parsed_globals)

Source from the content-addressed store, hash-verified

142 return url
143
144 def extract_region(self, parameters, parsed_globals):
145 match = re.match(
146 r'(vpce-.+\.)?git-codecommit(-fips)?\.([^.]+)\.(vpce\.)?amazonaws\.com',
147 parameters['host'],
148 )
149 if match is not None:
150 return match.group(3)
151 elif parsed_globals.region is not None:
152 return parsed_globals.region
153 else:
154 return self._session.get_config_variable('region')
155
156 def sign_request(self, region, url_to_sign):
157 credentials = self._session.get_credentials()

Callers 1

_run_mainMethod · 0.95

Calls 2

matchMethod · 0.80
get_config_variableMethod · 0.45

Tested by

no test coverage detected