예제 #1
0
 def update_depoly_job(self):
     job = OperationLogDal.get_deploy_job(self.job_id)
     data = dict(op_result='ok')
     data['op_after'] = json.loads(job.op_after)
     if self.unfinished:
         data['op_result'] = 'fail'
         data['op_after']['unfinished'] = self.unfinished
         data['op_after'] = json.dumps(data['op_after'])
         send_alert_email(u'主机更新named.conf失败, 主机信息:\n%s' %
                          json.dumps(self.unfinished, indent=4))
     OperationLogDal.update_opration_log(self.job_id, data)
예제 #2
0
 def run(self):
     with self.app.app_context():
         job = OperationLogDal.get_deploy_job(self.job_id)
         if not job or job.op_result != 'wait':
             raise DeployException(
                 'No deploy job id=%s or job state=wait.' % self.job_id)
         OperationLogDal.update_opration_log(self.job_id,
                                             {'op_result': 'start'})
         self.deploy_info = json.loads(job.op_before)
         self.deploy_type = job.op_domain
         if job.op_domain == 'named.conf':
             self.update_named_conf()
         elif job.op_domain == 'acl':
             self.update_acl()
         if self.notify_failed:
             pass
         self.check_normal_update()
예제 #3
0
 def run(self):
     with self.app.app_context():
         job = OperationLogDal.get_deploy_job(self.job_id)
         if not job or job.op_result != 'wait':
             raise DeployException('No deploy job id=%s or job state=wait.' % self.job_id)
         OperationLogDal.update_opration_log(self.job_id, {
             'op_result': 'start'
         })
         self.deploy_info = json.loads(job.op_before)
         self.deploy_type = job.op_domain
         if job.op_domain == 'named.conf':
             self.update_named_conf()
         elif job.op_domain == 'acl':
             self.update_acl()
         elif job.op_domain == 'zone':
             self.init_zone()
         if self.notify_failed:
             pass
     with self.app.app_context():
         self.check_normal_update()
예제 #4
0
파일: deploy.py 프로젝트: znavy/open_dnsdb
 def check_normal_update(self):
     time.sleep(self.expire)
     job = OperationLogDal.get_deploy_job(self.job_id)
     if job.op_result == 'start':
         OperationLogDal.update_opration_log(self.job_id,
                                             {'op_result': 'fail'})
예제 #5
0
 def check_normal_update(self):
     time.sleep(self.expire)
     job = OperationLogDal.get_deploy_job(self.job_id)
     if job.op_result == 'start':
         OperationLogDal.update_opration_log(self.job_id, {'op_result': 'fail'})