~ubuntu-branches/ubuntu/saucy/heat/saucy

« back to all changes in this revision

Viewing changes to heat/engine/dependencies.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Adam Gandelman
  • Date: 2013-09-08 21:51:19 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20130908215119-r939tu4aumqgdrkx
Tags: 2013.2~b3-0ubuntu1
[ Chuck Short ]
* New upstream release.
* debian/control: Add python-netaddr as build-dep.
* debian/heat-common.install: Remove heat-boto and associated man-page
* debian/heat-common.install: Remove heat-cfn and associated man-page
* debian/heat-common.install: Remove heat-watch and associated man-page
* debian/patches/fix-sqlalchemy-0.8.patch: Dropped

[ Adam Gandelman ]
* debian/patches/default-kombu.patch: Dropped.
* debian/patches/default-sqlite.patch: Refreshed.
* debian/*.install, rules: Install heat.conf.sample as common
  config file in heat-common. Drop other per-package configs, they
  are no longer used.
* debian/rules: Clean pbr .egg from build dir if it exists.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from heat.openstack.common.gettextutils import _
22
22
 
23
23
 
24
 
class CircularDependencyException(exception.OpenstackException):
 
24
class CircularDependencyException(exception.HeatException):
25
25
    message = _("Circular Dependency Found: %(cycle)s")
26
26
 
27
27
 
112
112
        '''Return a copy of the graph with the edges reversed.'''
113
113
        return Graph(self.map(lambda n: n.reverse_copy()))
114
114
 
 
115
    def edges(self):
 
116
        '''Return an iterator over all of the edges in the graph.'''
 
117
        def outgoing_edges(rqr, node):
 
118
            if node.disjoint():
 
119
                yield (rqr, None)
 
120
            else:
 
121
                for rqd in node:
 
122
                    yield (rqr, rqd)
 
123
        return itertools.chain.from_iterable(outgoing_edges(*i)
 
124
                                             for i in self.iteritems())
 
125
 
115
126
    def __delitem__(self, key):
116
127
        '''Delete the node given by the specified key from the graph.'''
117
128
        node = self[key]
213
224
        '''
214
225
        return str(self._graph)
215
226
 
216
 
    def _edges(self):
217
 
        '''Return an iterator over all of the edges in the graph.'''
218
 
        def outgoing_edges(rqr, node):
219
 
            if node.disjoint():
220
 
                yield (rqr, None)
221
 
            else:
222
 
                for rqd in node:
223
 
                    yield (rqr, rqd)
224
 
        return itertools.chain.from_iterable(outgoing_edges(*i)
225
 
                                             for i in self._graph.iteritems())
226
 
 
227
227
    def __repr__(self):
228
228
        '''Return a string representation of the object.'''
229
 
        return 'Dependencies([%s])' % ', '.join(repr(e) for e in self._edges())
 
229
        edge_reprs = (repr(e) for e in self._graph.edges())
 
230
        return 'Dependencies([%s])' % ', '.join(edge_reprs)
230
231
 
231
232
    def graph(self, reverse=False):
232
233
        '''Return a copy of the underlying dependency graph.'''