Esempio n. 1
0
def _post_flatten(graph):
    dup_names = misc.get_duplicate_keys(graph.nodes_iter(),
                                        key=lambda node: node.name)
    if dup_names:
        raise exceptions.InvariantViolationException(
            "Tasks with duplicate names found: %s"
            % ', '.join(sorted(dup_names)))
    return graph
Esempio n. 2
0
def _post_flatten(graph):
    dup_names = misc.get_duplicate_keys(graph.nodes_iter(),
                                        key=lambda node: node.name)
    if dup_names:
        raise exceptions.InvariantViolationException(
            "Tasks with duplicate names found: %s" %
            ', '.join(sorted(dup_names)))
    return graph
Esempio n. 3
0
 def _post_flatten(self, graph):
     """Called after the flattening of the item finishes successfully."""
     dup_names = misc.get_duplicate_keys(graph.nodes_iter(),
                                         key=lambda node: node.name)
     if dup_names:
         dup_names = ', '.join(sorted(dup_names))
         raise exceptions.InvariantViolation("Tasks with duplicate names "
                                             "found: %s" % (dup_names))
     self._history.clear()
Esempio n. 4
0
 def _post_flatten(self, graph):
     """Called after the flattening of the item finishes successfully."""
     dup_names = misc.get_duplicate_keys(graph.nodes_iter(),
                                         key=lambda node: node.name)
     if dup_names:
         dup_names = ', '.join(sorted(dup_names))
         raise exceptions.InvariantViolation("Tasks with duplicate names "
                                             "found: %s" % (dup_names))
     self._history.clear()
Esempio n. 5
0
 def _post_compile(self, graph, node):
     """Called after the compilation of the root finishes successfully."""
     dup_names = misc.get_duplicate_keys(graph.nodes_iter(),
                                         key=lambda node: node.name)
     if dup_names:
         raise exc.Duplicate(
             "Atoms with duplicate names found: %s" % (sorted(dup_names)))
     if graph.number_of_nodes() == 0:
         raise exc.Empty("Root container '%s' (%s) is empty"
                         % (self._root, type(self._root)))
     self._history.clear()
Esempio n. 6
0
 def _post_flatten(self, graph):
     """Called after the flattening of the item finishes successfully."""
     dup_names = misc.get_duplicate_keys(graph.nodes_iter(), key=lambda node: node.name)
     if dup_names:
         dup_names = ", ".join(sorted(dup_names))
         raise exc.Duplicate("Atoms with duplicate names " "found: %s" % (dup_names))
     self._history.clear()
     # NOTE(harlowja): this one can be expensive to calculate (especially
     # the cycle detection), so only do it if we know debugging is enabled
     # and not under all cases.
     if LOG.isEnabledFor(logging.DEBUG):
         LOG.debug("Translated '%s' into a graph:", self._root)
         for line in graph.pformat().splitlines():
             # Indent it so that it's slightly offset from the above line.
             LOG.debug(" %s", line)
Esempio n. 7
0
 def _post_compile(self, graph, node):
     """Called after the compilation of the root finishes successfully."""
     dup_names = misc.get_duplicate_keys(
         (node for node, node_attrs in graph.nodes_iter(data=True)
          if node_attrs['kind'] in ATOMS),
         key=lambda node: node.name)
     if dup_names:
         raise exc.Duplicate("Atoms with duplicate names found: %s" %
                             (sorted(dup_names)))
     atoms = iter_utils.count(
         node for node, node_attrs in graph.nodes_iter(data=True)
         if node_attrs['kind'] in ATOMS)
     if atoms == 0:
         raise exc.Empty("Root container '%s' (%s) is empty" %
                         (self._root, type(self._root)))
     self._history.clear()
Esempio n. 8
0
 def _post_flatten(self, graph, node):
     """Called after the flattening of the root finishes successfully."""
     dup_names = misc.get_duplicate_keys(graph.nodes_iter(), key=lambda node: node.name)
     if dup_names:
         raise exc.Duplicate("Atoms with duplicate names found: %s" % (sorted(dup_names)))
     if graph.number_of_nodes() == 0:
         raise exc.Empty("Root container '%s' (%s) is empty" % (self._root, type(self._root)))
     self._history.clear()
     # NOTE(harlowja): this one can be expensive to calculate (especially
     # the cycle detection), so only do it if we know debugging is enabled
     # and not under all cases.
     if LOG.isEnabledFor(logging.DEBUG):
         LOG.debug("Translated '%s'", self._root)
         LOG.debug("Graph:")
         for line in graph.pformat().splitlines():
             # Indent it so that it's slightly offset from the above line.
             LOG.debug("  %s", line)
         LOG.debug("Hierarchy:")
         for line in node.pformat().splitlines():
             # Indent it so that it's slightly offset from the above line.
             LOG.debug("  %s", line)
Esempio n. 9
0
 def _post_flatten(self, graph, node):
     """Called after the flattening of the root finishes successfully."""
     dup_names = misc.get_duplicate_keys(graph.nodes_iter(),
                                         key=lambda node: node.name)
     if dup_names:
         raise exc.Duplicate("Atoms with duplicate names found: %s" %
                             (sorted(dup_names)))
     if graph.number_of_nodes() == 0:
         raise exc.Empty("Root container '%s' (%s) is empty" %
                         (self._root, type(self._root)))
     self._history.clear()
     # NOTE(harlowja): this one can be expensive to calculate (especially
     # the cycle detection), so only do it if we know BLATHER is enabled
     # and not under all cases.
     if LOG.isEnabledFor(logging.BLATHER):
         LOG.blather("Translated '%s'", self._root)
         LOG.blather("Graph:")
         for line in graph.pformat().splitlines():
             # Indent it so that it's slightly offset from the above line.
             LOG.blather("  %s", line)
         LOG.blather("Hierarchy:")
         for line in node.pformat().splitlines():
             # Indent it so that it's slightly offset from the above line.
             LOG.blather("  %s", line)