本文整理汇总了Python中pyvcloud.system_test_framework.environment.Environment._get_netpool_name_to_use方法的典型用法代码示例。如果您正苦于以下问题:Python Environment._get_netpool_name_to_use方法的具体用法?Python Environment._get_netpool_name_to_use怎么用?Python Environment._get_netpool_name_to_use使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyvcloud.system_test_framework.environment.Environment
的用法示例。
在下文中一共展示了Environment._get_netpool_name_to_use方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __create_ovdc
# 需要导入模块: from pyvcloud.system_test_framework.environment import Environment [as 别名]
# 或者: from pyvcloud.system_test_framework.environment.Environment import _get_netpool_name_to_use [as 别名]
def __create_ovdc(self):
"""Creates an org vdc with the name specified in the test class.
:raises: Exception: if the class variable _org_href or _pvdc_name
is not populated.
"""
system = System(TestIpSecVpn._client,
admin_resource=TestIpSecVpn._client.get_admin())
if TestIpSecVpn._org is None:
org_name = TestIpSecVpn._config['vcd']['default_org_name']
org_resource_list = TestIpSecVpn._client.get_org_list()
org = TestIpSecVpn._org
ovdc_name = TestIpSecVpn._orgvdc_name
if self.__check_ovdc(org, ovdc_name):
return
storage_profiles = [{
'name':
TestIpSecVpn._config['vcd']['default_storage_profile_name'],
'enabled':
True,
'units':
'MB',
'limit':
0,
'default':
True
}]
netpool_to_use = Environment._get_netpool_name_to_use(system)
vdc_resource = org.create_org_vdc(
ovdc_name,
TestIpSecVpn._pvdc_name,
network_pool_name=netpool_to_use,
network_quota=TestIpSecVpn._config['vcd']['default_network_quota'],
storage_profiles=storage_profiles,
uses_fast_provisioning=True,
is_thin_provision=True)
TestIpSecVpn._client.get_task_monitor().wait_for_success(
task=vdc_resource.Tasks.Task[0])
org.reload()
# The following contraption is required to get the non admin href of
# the ovdc. vdc_resource contains the admin version of the href since
# we created the ovdc as a sys admin.
self.__check_ovdc(org, ovdc_name)