def create_template(self): v = self.get_variables() t = self.template base_name = "Dummy" for i in range(v["Count"]): name = "%s%s" % (base_name, i) last_name = None if i: last_name = "%s%s" % (base_name, i - 1) wch = WaitConditionHandle(name) if last_name is not None: wch.DependsOn = last_name t.add_resource(wch) self.add_output("OutputValue", str(v["OutputValue"])) self.add_output("WCHCount", str(v["Count"])) if v["BreakLast"]: t.add_resource( WaitCondition( "BrokenWaitCondition", Handle=wch.Ref(), # Timeout is made deliberately large so CF rejects it Timeout=2**32, Count=0))
def create_template(self) -> None: """Create template.""" base_name = "Dummy" for i in range(self.variables["Count"]): name = "%s%s" % (base_name, i) last_name = None if i: last_name = "%s%s" % (base_name, i - 1) wch = WaitConditionHandle(name) if last_name is not None: wch.DependsOn = last_name self.template.add_resource(wch) if self.variables["BreakLast"] and i == self.variables["Count"] - 1: self.template.add_resource( WaitCondition( "BrokenWaitCondition", Handle=wch.Ref(), # Timeout is made deliberately large so CF rejects it Timeout=2**32, Count=0, )) self.add_output("OutputValue", str(self.variables["OutputValue"])) self.add_output("WCHCount", str(self.variables["Count"]))