def clear_targets(force = False):
if not force:
from os import _exit
import textwrap
warning = """
clear-targets will forcibly unmount and unconfigure all Lustre targets
on EVERY node in this HA domain. This is an irreversible and
potentially very destructive operation. Data loss may occur. Please
do not use it unless you fully understand the consequences! If you
are sure that this command does what you intend to do, then you must
supply the --force flag to avoid seeing this message.
"""
console_log.warn(textwrap.fill(textwrap.dedent(warning)))
_exit(1)
for resource, attrs in _query_ha_targets().items():
console_log.info("Stopping %s" % resource)
stop_target(attrs['ha_label'])
console_log.info("Unconfiguring %s" % resource)
unconfigure_target_ha(True, attrs['ha_label'], attrs['uuid'])
manage_targets.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录