Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
b838ecc3
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,发现更多精彩内容 >>
未验证
提交
b838ecc3
编写于
5月 28, 2019
作者:
P
Praveen K Pandey
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'narasimhan-v-lv_utils_vg_reactivate'
Signed-off-by: Praveen K Pandey praveen@linux.vnet.ibm.com
上级
4a488ffd
1352b713
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
28 addition
and
0 deletion
+28
-0
avocado/utils/lv_utils.py
avocado/utils/lv_utils.py
+28
-0
未找到文件。
avocado/utils/lv_utils.py
浏览文件 @
b838ecc3
...
...
@@ -618,6 +618,34 @@ def lv_mount(vg_name, lv_name, mount_loc, create_filesystem=""):
raise
LVException
(
"Fail to mount logical volume: %s"
%
ex
)
def
vg_reactivate
(
vg_name
,
timeout
=
10
,
export
=
False
):
"""
In case of unclean shutdowns some of the vgs is still active and merging
is postponed. Use this function to attempt to deactivate and reactivate
all of them to cause the merge to happen.
:param str vg_name: name of the volume group
:param int timeout: timeout between operations
:raises: :py:class:`LVException` if the logical volume is still active
"""
try
:
process
.
run
(
"vgchange -an %s"
%
vg_name
,
sudo
=
True
)
time
.
sleep
(
timeout
)
if
export
:
process
.
run
(
"vgexport %s"
%
vg_name
,
sudo
=
True
)
time
.
sleep
(
timeout
)
process
.
run
(
"vgimport %s"
%
vg_name
,
sudo
=
True
)
time
.
sleep
(
timeout
)
process
.
run
(
"vgchange -ay %s"
%
vg_name
,
sudo
=
True
)
time
.
sleep
(
timeout
)
except
process
.
CmdError
:
log_msg
=
"Failed to reactivate %s - please, nuke the process that uses it first."
LOGGER
.
error
(
log_msg
,
vg_name
)
raise
LVException
(
"The Volume group %s is still active"
%
vg_name
)
def
lv_umount
(
vg_name
,
lv_name
):
"""
Unmount a Logical volume from a mount location.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录