Explorar el Código

修正event_processor异常处理退出问题

James Iter hace 8 años
padre
commit
9e4ec15518
Se han modificado 4 ficheros con 4 adiciones y 5 borrados
  1. 1 1
      INSTALL.sh
  2. 1 1
      docs/install.md
  3. 0 1
      models/event_processor.py
  4. 2 2
      models/guest.py

+ 1 - 1
INSTALL.sh

@@ -106,7 +106,7 @@ function prepare() {
     rm -f ${GENERATE_PASSWORD_SCRIPT_TMP_PATH}
 
     yum install epel-release -y
-    yum install python2-pip git -y
+    yum install python2-pip git psmisc -y
     pip install --upgrade pip -i ${PYPI}
     pip install virtualenv -i ${PYPI}
 }

+ 1 - 1
docs/install.md

@@ -57,7 +57,7 @@ rm -f ${GENERATE_PASSWORD_SCRIPT_TMP_PATH}
 ## 安装必要软件
 
 ``` bash
-yum install epel-release python2-pip git -y
+yum install epel-release python2-pip git psmisc -y
 pip install --upgrade pip -i ${PYPI}
 pip install virtualenv -i ${PYPI}
 ```

+ 0 - 1
models/event_processor.py

@@ -365,5 +365,4 @@ class EventProcessor(object):
 
             except Exception as e:
                 logger.error(traceback.format_exc())
-                exit(1)
 

+ 2 - 2
models/guest.py

@@ -72,7 +72,7 @@ class Guest(ORM):
 
     def add_boot_jobs(self, boot_jobs_id):
         if not isinstance(boot_jobs_id, list):
-            raise
+            raise ValueError('The boot_jobs_id must be a list.')
 
         key = self.get_boot_jobs_key()
         db.r.sadd(key, *boot_jobs_id)
@@ -83,7 +83,7 @@ class Guest(ORM):
 
     def delete_boot_jobs(self, boot_jobs_id):
         if not isinstance(boot_jobs_id, list):
-            raise
+            raise ValueError('The boot_jobs_id must be a list.')
 
         key = self.get_boot_jobs_key()
         db.r.srem(key, *boot_jobs_id)