本文整理汇总了Python中ci.tests.general.general.General.get_mountpoints方法的典型用法代码示例。如果您正苦于以下问题:Python General.get_mountpoints方法的具体用法?Python General.get_mountpoints怎么用?Python General.get_mountpoints使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ci.tests.general.general.General
的用法示例。
在下文中一共展示了General.get_mountpoints方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: shrink_vpool
# 需要导入模块: from ci.tests.general.general import General [as 别名]
# 或者: from ci.tests.general.general.General import get_mountpoints [as 别名]
def shrink_vpool(storage_driver):
"""
Remove a Storage Driver from a vPool
:param storage_driver: Storage Driver to remove from the vPool
:return: None
"""
vpool = storage_driver.vpool
if GeneralHypervisor.get_hypervisor_type() == "VMWARE":
root_client = SSHClient(storage_driver.storagerouter, username="root")
if storage_driver.mountpoint in General.get_mountpoints(root_client):
root_client.run(["umount", "storage_driver.mountpoint"])
task_result = GeneralVPool.api.execute_post_action(
component="vpools",
guid=vpool.guid,
action="shrink_vpool",
data={"storagerouter_guid": storage_driver.storagerouter.guid},
wait=True,
timeout=GeneralVPool.TIMEOUT_ADD_VPOOL,
)
if task_result[0] is not True:
raise RuntimeError(
"Storage Driver with ID {0} was not successfully removed from vPool {1}".format(
storage_driver.storagedriver_id, vpool.name
),
task_result,
)
return GeneralVPool.get_vpool_by_name(vpool_name=vpool.name)
示例2: unmount_vpool
# 需要导入模块: from ci.tests.general.general import General [as 别名]
# 或者: from ci.tests.general.general.General import get_mountpoints [as 别名]
def unmount_vpool(vpool, root_client):
"""
Umount the vPool
:param vpool: vPool to umount
:param root_client: SSHClient object
:return: None
"""
mountpoint = '/mnt/{0}'.format(vpool.name)
if mountpoint in General.get_mountpoints(root_client):
root_client.run('umount {0}'.format(mountpoint))
示例3: mount_vpool
# 需要导入模块: from ci.tests.general.general import General [as 别名]
# 或者: from ci.tests.general.general.General import get_mountpoints [as 别名]
def mount_vpool(vpool, root_client):
"""
Mount the vPool locally
:param vpool: vPool to mount locally
:param root_client: SSHClient object
:return: None
"""
mountpoint = '/mnt/{0}'.format(vpool.name)
if mountpoint not in General.get_mountpoints(root_client):
root_client.run('mount 127.0.0.1:{0} {0}'.format(mountpoint))
示例4: mount_vpool
# 需要导入模块: from ci.tests.general.general import General [as 别名]
# 或者: from ci.tests.general.general.General import get_mountpoints [as 别名]
def mount_vpool(vpool, root_client):
"""
Mount the vPool locally
:param vpool: vPool to mount locally
:param root_client: SSHClient object
:return: None
"""
mountpoint = "/mnt/{0}".format(vpool.name)
if mountpoint not in General.get_mountpoints(root_client):
root_client.run(["mount", "127.0.0.1:" + mountpoint, mountpoint])
示例5: shrink_vpool
# 需要导入模块: from ci.tests.general.general import General [as 别名]
# 或者: from ci.tests.general.general.General import get_mountpoints [as 别名]
def shrink_vpool(storage_driver):
"""
Remove a Storage Driver from a vPool
:param storage_driver: Storage Driver to remove from the vPool
:return: None
"""
vpool = storage_driver.vpool
if storage_driver.storagerouter.pmachine.hvtype == 'VMWARE':
root_client = SSHClient(storage_driver.storagerouter, username='root')
if storage_driver.mountpoint in General.get_mountpoints(root_client):
root_client.run('umount {0}'.format(storage_driver.mountpoint))
task_result = GeneralVPool.api.execute_post_action(component='vpools',
guid=vpool.guid,
action='shrink_vpool',
data={'storagerouter_guid': storage_driver.storagerouter.guid},
wait=True,
timeout=500)
if task_result[0] is not True:
raise RuntimeError('Storage Driver with ID {0} was not successfully removed from vPool {1}'.format(storage_driver.storagedriver_id, vpool.name))
return GeneralVPool.get_vpool_by_name(vpool_name=vpool.name)