reduce cognitive complexity of _local_status

This commit is contained in:
Fábio Santos
2020-01-14 20:32:46 +00:00
parent cfbdccdbed
commit e5d35cb3ce
+10 -6
View File
@@ -10,14 +10,9 @@ from . import locked
logger = logging.getLogger(__name__)
def _local_status(self, targets=None, with_deps=False):
def _joint_status(stages):
status = {}
if targets:
stages = cat(self.collect(t, with_deps=with_deps) for t in targets)
else:
stages = self.collect(None, with_deps=with_deps)
for stage in stages:
if stage.locked and not stage.is_repo_import:
logger.warning(
@@ -32,6 +27,15 @@ def _local_status(self, targets=None, with_deps=False):
return status
def _local_status(self, targets=None, with_deps=False):
if targets:
stages = cat(self.collect(t, with_deps=with_deps) for t in targets)
else:
stages = self.collect(None, with_deps=with_deps)
return _joint_status(stages)
def _cloud_status(
self,
targets=None,