Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
openEuler-Advisor
提交
94981526
O
openEuler-Advisor
项目概览
openeuler
/
openEuler-Advisor
通知
40
Star
4
Fork
4
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openEuler-Advisor
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
94981526
编写于
9月 04, 2020
作者:
O
openeuler-ci-bot
提交者:
Gitee
9月 04, 2020
浏览文件
操作
浏览文件
下载
差异文件
!124 解决系统配置文件的log_level配置项不工作、在初始化失败没有生成lifecycle.db时,查询pkgship issue报错问题
Merge pull request !124 from 魔箭胖胖/master
上级
33a3322a
119f1cd2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
16 deletion
+16
-16
packageship/packageship/application/__init__.py
packageship/packageship/application/__init__.py
+2
-2
packageship/packageship/application/apps/lifecycle/view.py
packageship/packageship/application/apps/lifecycle/view.py
+12
-12
packageship/packageship/libs/log/loghelper.py
packageship/packageship/libs/log/loghelper.py
+2
-2
未找到文件。
packageship/packageship/application/__init__.py
浏览文件 @
94981526
...
...
@@ -47,11 +47,11 @@ def init_app(operation):
app
=
Flask
(
__name__
)
# log configuration
setup_log
(
Config
)
app
.
logger
.
addHandler
(
setup_log
(
Config
)
)
# Load configuration items
app
.
config
.
from_object
(
Config
)
app
.
config
.
from_object
(
Config
()
)
# Register a scheduled task
scheduler
=
APScheduler
()
...
...
packageship/packageship/application/apps/lifecycle/view.py
浏览文件 @
94981526
...
...
@@ -304,7 +304,7 @@ class IssueView(Resource):
return
issue_data
except
(
SQLAlchemyError
,
DisconnectionError
)
as
error
:
current_app
.
logger
.
error
(
error
)
return
[]
return
ResponseCode
.
response_json
(
ResponseCode
.
DATABASE_NOT_FOUND
)
def
get
(
self
):
"""
...
...
@@ -350,10 +350,12 @@ class IssueType(Resource):
with
DBHelper
(
db_name
=
'lifecycle'
)
as
database
:
issues_query
=
database
.
session
.
query
(
PackagesIssue
.
issue_type
).
group_by
(
PackagesIssue
.
issue_type
).
all
()
return
[
issue_query
[
0
]
for
issue_query
in
issues_query
]
return
jsonify
(
ResponseCode
.
response_json
(
ResponseCode
.
SUCCESS
,
[
issue_query
[
0
]
for
issue_query
in
issues_query
]))
except
(
SQLAlchemyError
,
DisconnectionError
)
as
error
:
current_app
.
logger
.
error
(
error
)
return
[]
return
jsonify
(
ResponseCode
.
response_json
(
ResponseCode
.
PARAM_ERROR
))
def
get
(
self
):
"""
...
...
@@ -370,9 +372,7 @@ class IssueType(Resource):
TypeError: Exception of type
Error: Abnormal error
"""
issue_dict
=
self
.
_get_issue_type
()
return
jsonify
(
ResponseCode
.
response_json
(
ResponseCode
.
SUCCESS
,
issue_dict
))
return
self
.
_get_issue_type
()
class
IssueStatus
(
Resource
):
...
...
@@ -389,10 +389,12 @@ class IssueStatus(Resource):
with
DBHelper
(
db_name
=
'lifecycle'
)
as
database
:
issues_query
=
database
.
session
.
query
(
PackagesIssue
.
issue_status
).
group_by
(
PackagesIssue
.
issue_status
).
all
()
return
[
issue_query
[
0
]
for
issue_query
in
issues_query
]
return
jsonify
(
ResponseCode
.
response_json
(
ResponseCode
.
SUCCESS
,
[
issue_query
[
0
]
for
issue_query
in
issues_query
]))
except
(
SQLAlchemyError
,
DisconnectionError
)
as
error
:
current_app
.
logger
.
error
(
error
)
return
[]
return
jsonify
(
ResponseCode
.
response_json
(
ResponseCode
.
PARAM_ERROR
))
def
get
(
self
):
"""
...
...
@@ -409,10 +411,8 @@ class IssueStatus(Resource):
TypeError: Exception of type
Error: Abnormal error
"""
issue_dict
=
self
.
_get_issue_status
()
return
jsonify
(
ResponseCode
.
response_json
(
ResponseCode
.
SUCCESS
,
issue_dict
))
return
self
.
_get_issue_status
()
class
IssueCatch
(
Resource
):
"""
...
...
packageship/packageship/libs/log/loghelper.py
浏览文件 @
94981526
...
...
@@ -52,8 +52,8 @@ def setup_log(config=None):
file_log_handler
.
setFormatter
(
formatter
)
logging
.
getLogger
().
addHandler
(
file_log_handler
)
return
file_log_handler
class
Log
():
"""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录