提交 19351091 编写于 作者: J jiang

Clear status code information and Improve interface input and participate in input and output and

Remove exception
上级 11e894a3
......@@ -36,10 +36,9 @@ class ResponseCode():
PACK_NAME_NOT_FOUND = "4003"
CONNECT_DB_ERROR = "4004"
INPUT_NONE = "4005"
# Delete database module error status code
FILE_NOT_FOUND = "40041"
FILE_NOT_FOUND = "4006"
# Database operation module error status code
DELETE_DB_ERROR = "40051"
# Database initialization module error status code
CONFIGFILE_PATH_EMPTY = "50001"
FAILED_CREATE_DATABASE_TABLE = "50002"
TYPE_ERROR = "50003"
......
......@@ -15,6 +15,7 @@ from packageship.libs.exception import Error
def get_packages(dbname):
'''
Description: Get all packages info
:param dbname: Database name
:return: package info
'''
with DBHelper(db_name=dbname) as db_name:
......@@ -37,6 +38,7 @@ def get_packages(dbname):
def buildep_packages(dbname, src_pack_id):
"""
Description: Query package layer 1 compilation dependency
:param dbname: databases name
:param src_pack_id: srcpackage id
:return: buildDep Compile dependencies of source packages
......@@ -58,6 +60,7 @@ def buildep_packages(dbname, src_pack_id):
def sub_packages(dbname, src_pack_id):
"""
Description: Query package layer 1 installation dependency
:param dbname: databases name
:param src_pack_id: srcpackage id
:return: subpack Source package to binary package, then find the installation dependencies
......@@ -92,6 +95,8 @@ def sub_packages(dbname, src_pack_id):
def get_single_package(dbname, sourcename):
'''
Description: Get all packages info
:param dbname: Database name
:param sourcename: Source package name
:return: package info
'''
with DBHelper(db_name=dbname) as db_name:
......@@ -120,7 +125,11 @@ def update_single_package(
maintainer,
maintain_level):
"""
change single package management
Description: change single package management
:param package_name: package name
:param dbname: Database name
:param maintainer: maintainer info
:param maintain_level: maintain_level info
:return: message success or failed
"""
with DBHelper(db_name=dbname) as db_name:
......@@ -136,7 +145,14 @@ def update_maintaniner_info(package_name,
maintaniner,
maintainlevel):
'''
Separate maintenance information
"""
update separately maintaniner info
:param package_name: package name
:param dbname: Database name
:param maintainer: maintainer info
:param maintain_level: maintain_level info
:return: message success or failed
"""
'''
with DBHelper(db_name=dbname) as db_name:
src_pack_obj = db_name.session.query(src_pack).filter_by(
......
......@@ -450,7 +450,7 @@ class InitSystem(Resource):
except FileNotFoundError as file_not_found_error:
LOGGER.logger.error(file_not_found_error)
abnormal = ResponseCode.FILE_NOT_FIND_ERROR
except (Error, Exception) as error:
except Error as error:
LOGGER.logger.error(error)
abnormal = ResponseCode.FAILED_CREATE_DATABASE_TABLE
if abnormal is not None:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册