示例#1
0
文件: sunny.py 项目: ooici/ape
    def get_nodes_broker(self):
        """ interrogate cloudinitd for rabbitmq parameters """

        if self.state==CREATED:
            raise ApeException('cannot query cloudinitd before Troop has been configured')

        vars = {}
        home = environ['HOME']

        try:
            cid = CloudInitD(home + '/.cloudinitd', db_name=self.launch_name, terminate=False, boot=False, ready=False)
        except APIUsageException, e:
            log.error("Problem loading records from cloudinit.d: %s", exc_info=True)
            raise
示例#2
0
文件: sunny.py 项目: ooici/ape
 def stop_nodes(self):
     system = self.configuration['launch-name']
     hosts = subprocess.check_output(['ec2-pycc', '--find', system]).split('\n')
     for host in hosts:
         try:
             subprocess.check_call(['ec2-pycc', '--stop', host])
             # TODO: terminate instance
         except:
             log.error('failed to stop container: ' + host)
     try:
         subprocess.check_call(['ec2-couch', '--stop', system])
         # TODO: terminate instance
     except:
         log.error('failed to stop DB server')
     try:
         subprocess.check_call(['ec2-rabbit', '--stop', system])
         # TODO: terminate instance
     except:
         log.error('failed to stop rabbit server')