Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
25299fdb
A
avocado
项目概览
openeuler
/
avocado
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
avocado
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
25299fdb
编写于
1月 02, 2018
作者:
A
Amador Pahim
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'clebergnu-lv_utils_fixes_v2'
Signed-off-by:
N
Amador Pahim
<
apahim@redhat.com
>
上级
9925cc43
96024b22
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
10 addition
and
10 deletion
+10
-10
avocado/utils/lv_utils.py
avocado/utils/lv_utils.py
+10
-10
未找到文件。
avocado/utils/lv_utils.py
浏览文件 @
25299fdb
...
...
@@ -157,7 +157,7 @@ def vg_ramdisk_cleanup(ramdisk_filename=None, vg_ramdisk_dir=None,
errs
=
[]
if
vg_name
is
not
None
:
loop_device
=
re
.
search
(
r
"([/\w-]+) +%s +lvm2"
%
vg_name
,
process
.
run
(
"pvs"
,
sudo
=
True
).
stdout
)
process
.
system_output
(
"pvs"
,
sudo
=
True
)
)
if
loop_device
is
not
None
:
loop_device
=
loop_device
.
group
(
1
)
process
.
run
(
"vgremove -f %s"
%
...
...
@@ -170,10 +170,10 @@ def vg_ramdisk_cleanup(ramdisk_filename=None, vg_ramdisk_dir=None,
errs
.
append
(
"wipe pv"
)
LOGGER
.
error
(
"Failed to wipe pv from %s: %s"
,
loop_device
,
result
)
if
loop_device
in
process
.
run
(
"losetup --all"
).
stdout
:
if
loop_device
in
process
.
system_output
(
"losetup --all"
)
:
ramdisk_filename
=
re
.
search
(
r
"%s: \[\d+\]:\d+ \(([/\w]+)\)"
%
loop_device
,
process
.
run
(
"losetup --all"
).
stdout
)
process
.
system_output
(
"losetup --all"
)
)
if
ramdisk_filename
is
not
None
:
ramdisk_filename
=
ramdisk_filename
.
group
(
1
)
...
...
@@ -444,7 +444,7 @@ def lv_take_snapshot(vg_name, lv_name,
process
.
run
(
cmd
,
sudo
=
True
)
except
process
.
CmdError
as
ex
:
if
(
'Logical volume "%s" already exists in volume group "%s"'
%
(
lv_snapshot_name
,
vg_name
)
in
ex
.
result
_obj
.
stderr
and
%
(
lv_snapshot_name
,
vg_name
)
in
ex
.
result
.
stderr
and
re
.
search
(
re
.
escape
(
lv_snapshot_name
+
" [active]"
),
process
.
run
(
"lvdisplay"
,
sudo
=
True
).
stdout
)):
# the above conditions detect if merge of snapshot was postponed
...
...
@@ -487,17 +487,17 @@ def lv_revert(vg_name, lv_name, lv_snapshot_name):
# detect if merge of snapshot was postponed
# and attempt to reactivate the volume.
active_lv_pattern
=
re
.
escape
(
"%s [active]"
%
lv_snapshot_name
)
lvdisplay_output
=
process
.
run
(
"lvdisplay"
,
sudo
=
True
).
stdout
if
(
'Snapshot could not be found'
in
ex
and
lvdisplay_output
=
process
.
system_output
(
"lvdisplay"
,
sudo
=
True
)
if
(
'Snapshot could not be found'
in
ex
.
result
.
stderr
and
re
.
search
(
active_lv_pattern
,
lvdisplay_output
)
or
"The Logical volume %s is still active"
%
lv_name
in
ex
):
"The Logical volume %s is still active"
%
lv_name
in
ex
.
result
.
stderr
):
LOGGER
.
debug
((
"Logical volume %s is still active! "
+
"Attempting to deactivate..."
),
lv_name
)
lv_reactivate
(
vg_name
,
lv_name
)
LOGGER
.
error
(
"Continuing after reactivation"
)
elif
'Snapshot could not be found'
in
ex
:
LOGGER
.
error
(
ex
)
LOGGER
.
error
(
"Could not revert to snapshot"
)
elif
'Snapshot could not be found'
in
ex
.
result
.
stderr
:
LOGGER
.
error
(
"Could not revert to snapshot:"
)
LOGGER
.
error
(
ex
.
result
)
else
:
raise
ex
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录