本文整理汇总了Python中pyvcloud.vcd.org.Org.change_catalog_owner方法的典型用法代码示例。如果您正苦于以下问题:Python Org.change_catalog_owner方法的具体用法?Python Org.change_catalog_owner怎么用?Python Org.change_catalog_owner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyvcloud.vcd.org.Org
的用法示例。
在下文中一共展示了Org.change_catalog_owner方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_02_change_catalog_owner
# 需要导入模块: from pyvcloud.vcd.org import Org [as 别名]
# 或者: from pyvcloud.vcd.org.Org import change_catalog_owner [as 别名]
def test_02_change_catalog_owner(self):
logged_in_org = self.client.get_org()
org = Org(self.client, resource=logged_in_org)
org.change_catalog_owner(self.config['vcd']['catalog'],
self.config['vcd']['new_catalog_owner'])
catalog_resource = org.get_catalog_resource(
self.config['vcd']['catalog'], True)
assert self.config['vcd']['new_catalog_owner'] \
== catalog_resource.Owner.User.get('name')
示例2: change_owner
# 需要导入模块: from pyvcloud.vcd.org import Org [as 别名]
# 或者: from pyvcloud.vcd.org.Org import change_catalog_owner [as 别名]
def change_owner(ctx, catalog_name, user_name):
try:
restore_session(ctx)
client = ctx.obj['client']
in_use_org_href = ctx.obj['profiles'].get('org_href')
org = Org(client, in_use_org_href)
org.change_catalog_owner(catalog_name, user_name)
stdout('catalog owner changed', ctx)
except Exception as e:
stderr(e, ctx)