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

Method remove

awscli/botocore/credentials.py:2192–2205  ·  view source on GitHub ↗

Removes a given ``Credentials`` instance from the chain. :param name: The short name of the credentials instance to remove. :type name: string

(self, name)

Source from the content-addressed store, hash-verified

2190 self.providers.insert(offset + 1, credential_provider)
2191
2192 def remove(self, name):
2193 """
2194 Removes a given ``Credentials`` instance from the chain.
2195
2196 :param name: The short name of the credentials instance to remove.
2197 :type name: string
2198 """
2199 available_methods = [p.METHOD for p in self.providers]
2200 if name not in available_methods:
2201 # It's not present. Fail silently.
2202 return
2203
2204 offset = available_methods.index(name)
2205 self.providers.pop(offset)
2206
2207 def get_provider(self, name):
2208 """Return a credential provider by name.

Callers 6

test_provider_unknownMethod · 0.95
_remove_itemMethod · 0.45

Calls

no outgoing calls

Tested by 2

test_provider_unknownMethod · 0.76