示例#1
0
    def state(self):
        """
        Report on state.
        """
        LOG.info("retrieving state of the running stack with id %s" %
                 self.stack_id)
        # LOG.info('Resolver state:')
        # LOG.info(resolver_state.__repr__())
        if self.stack_id is not None:
            topology = TopologyOrchestrator.get(self.stack_id)
            stk = self.deployer.details(topology.ext_id)
            res = {
                'state': stk['stack_status'],
                'name': stk['stack_name'],
                'id': stk['id']
            }
            if 'outputs' in stk:
                res['output'] = stk['outputs']
            output = ''
            try:
                output = res['output']
            except KeyError:
                pass

            LOG.debug(" state %s, output %s" % (res['state'], output))
            return res['state'], str(self.stack_id), output
        else:
            return 'CREATE_COMPLETE', 'N/A', ''
    def state(self):
        """
        Report on state.
        """
        LOG.info("retrieving state of the running stack with id %s" % self.stack_id)
        # LOG.info('Resolver state:')
        # LOG.info(resolver_state.__repr__())
        if self.stack_id is not None:
            topology = TopologyOrchestrator.get(self.stack_id)
            stk = self.deployer.details(topology.ext_id)
            res = {'state': stk['stack_status'],
               'name': stk['stack_name'],
               'id': stk['id']}
            if 'outputs' in stk:
                res['output'] = stk['outputs']
            output = ''
            try:
                output = res['output']
            except KeyError:
                pass

            LOG.debug(" state %s, output %s"%(res['state'],output))
            return res['state'], str(self.stack_id), output
        else:
            return 'CREATE_COMPLETE', 'N/A', ''
示例#3
0
 def dispose(self):
     """
     Dispose method
     """
     LOG.info("deleting topology with id %s " % self.stack_id)
     if self.stack_id is not None:
         topology = TopologyOrchestrator.get(self.stack_id)
         LOG.debug("topology to be deleted %s " % topology)
         self.deployer.dispose(topology)
         TopologyOrchestrator.delete(topology)
         self.stack_id = None
         if self.maas is not None:
             util.dispose_maas(self.token, self.maas)
 def dispose(self):
     """
     Dispose method
     """
     LOG.info("deleting topology with id %s " % self.stack_id)
     if self.stack_id is not None:
         topology = TopologyOrchestrator.get(self.stack_id)
         LOG.debug("topology to be deleted %s " % topology)
         self.deployer.dispose(topology)
         TopologyOrchestrator.delete(topology)
         self.stack_id = None
         if self.maas is not None:
             util.dispose_maas(self.token, self.maas)