diff --git a/util/names.py b/util/names.py index 67ceed982..f37f0135d 100644 --- a/util/names.py +++ b/util/names.py @@ -4,7 +4,7 @@ from functools import wraps from uuid import uuid4 -def parse_namespace_repository(repository, tag=False): +def parse_namespace_repository(repository, include_tag=False): parts = repository.rstrip('/').split('/', 1) if len(parts) < 2: namespace = 'library' @@ -12,15 +12,15 @@ def parse_namespace_repository(repository, tag=False): else: (namespace, repository) = parts - if tag: + if include_tag: parts = repository.split(':', 1) if len(parts) < 2: - tag = None + tag = 'latest' else: (repository, tag) = parts repository = urllib.quote_plus(repository) - if tag: + if include_tag: return (namespace, repository, tag) return (namespace, repository) @@ -34,7 +34,7 @@ def parse_repository_name(f): def parse_repository_name_and_tag(f): @wraps(f) def wrapper(repository, *args, **kwargs): - (namespace, repository, tag) = parse_namespace_repository(repository, tag=True) + namespace, repository, tag = parse_namespace_repository(repository, include_tag=True) return f(namespace, repository, tag, *args, **kwargs) return wrapper