Commit e2c150f3 authored by Jürg Billeter's avatar Jürg Billeter

_artifactcache: Add element paramater to has_fetch_remotes()

parent db503a42
......@@ -254,9 +254,12 @@ class ArtifactCache():
#
# Check whether any remote repositories are available for fetching.
#
# Args:
# element (Element): The Element to check
#
# Returns: True if any remote repositories are configured, False otherwise
#
def has_fetch_remotes(self):
def has_fetch_remotes(self, *, element=None):
return False
# has_push_remotes():
......
......@@ -64,8 +64,17 @@ class OSTreeCache(ArtifactCache):
################################################
# Implementation of abstract methods #
################################################
def has_fetch_remotes(self):
return self._has_fetch_remotes
def has_fetch_remotes(self, *, element=None):
if not self._has_fetch_remotes:
# No project has push remotes
return False
elif element is None:
# At least one (sub)project has fetch remotes
return True
else:
# Check whether the specified element's project has fetch remotes
remotes_for_project = self._remotes[element._get_project()]
return bool(remotes_for_project)
def has_push_remotes(self, *, element=None):
if not self._has_push_remotes:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment