self, username, password=None, email=None, registry=None,
              reauth=False, insecure_registry=False, dockercfg_path=None):

def _request_auth(self, registry):
        """
             self, username, password=None, email=None, registry=None,
              reauth=False, insecure_registry=False, dockercfg_path=None):
        """
        if registry:
            if registry.auth:
                registry.auth.load_dockercfg()

            try:
                self._client_session.login(username=registry.auth.user,
                                           password=registry.auth.passwd,
                                           dockercfg_path=registry.auth.config_path,
                                           reauth=True if registry.auth.auth_type == 'registry_rubber' else False,
                                           registry=registry.auth.registry)
            except Exception:
                raise
        else:
            raise Exception("a registry is required when requesting auth.")