Merge "Skip invariant checking and adding when nothing provided"

This commit is contained in:
Jenkins
2014-01-24 12:54:04 +00:00
committed by Gerrit Code Review
2 changed files with 7 additions and 1 deletions

View File

@@ -37,6 +37,9 @@ class Flow(flow.Flow):
def add(self, *items):
"""Adds a given task/tasks/flow/flows to this flow."""
if not items:
return self
# NOTE(imelnikov): we add item to the end of flow, so it should
# not provide anything previous items of the flow require
requires = self.requires

View File

@@ -40,7 +40,10 @@ class Flow(flow.Flow):
def add(self, *items):
"""Adds a given task/tasks/flow/flows to this flow."""
# check that items are actually independent
if not items:
return self
# NOTE(harlowja): check that items to be added are actually independent
provides = self.provides
old_requires = self.requires
for item in items: