Extract only the hostname part from self.registry This is needed for update_dockercfg() to register only the host part of a specified registry URL in the .dockercfg.

This commit is contained in:
Olaf Kilian 2015-05-06 22:43:28 +02:00 committed by Matt Clay
parent c42d94edd1
commit e998090d52

View file

@ -139,6 +139,10 @@ class DockerLoginManager:
if self.reauth: if self.reauth:
self.log.append("Enforcing reauthentification") self.log.append("Enforcing reauthentification")
# Extract hostname part from self.registry if url was specified.
registry_url = urlparse(self.registry)
self.registry = registry_url.netloc or registry_url.path
# Connect to registry and login if not already logged in or reauth is enforced. # Connect to registry and login if not already logged in or reauth is enforced.
try: try:
self.response = self.client.login( self.response = self.client.login(