本文整理汇总了Python中katello.client.api.custom_info.CustomInfoAPI.update_custom_info方法的典型用法代码示例。如果您正苦于以下问题:Python CustomInfoAPI.update_custom_info方法的具体用法?Python CustomInfoAPI.update_custom_info怎么用?Python CustomInfoAPI.update_custom_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类katello.client.api.custom_info.CustomInfoAPI
的用法示例。
在下文中一共展示了CustomInfoAPI.update_custom_info方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from katello.client.api.custom_info import CustomInfoAPI [as 别名]
# 或者: from katello.client.api.custom_info.CustomInfoAPI import update_custom_info [as 别名]
def run(self):
org_name = self.get_option("org")
env_name = self.get_option("environment")
sys_name = self.get_option("name")
sys_uuid = self.get_option("uuid")
keyname = self.get_option("keyname")
new_value = self.get_option("value")
system = get_system(org_name, sys_name, env_name, sys_uuid)
custom_info_api = CustomInfoAPI()
response = custom_info_api.update_custom_info("system", system["id"], keyname, new_value)
ident = sys_uuid if sys_uuid else sys_name
if response is not None:
print _("Successfully updated Custom Information [ %(keyname)s ] for System [ %(ident)s ]") % {
"keyname": keyname,
"ident": ident,
}
else:
print _("Could not update Custom Information [ %(keyname)s ] for System [ %(ident)s ]") % {
"keyname": keyname,
"ident": ident,
}
示例2: run
# 需要导入模块: from katello.client.api.custom_info import CustomInfoAPI [as 别名]
# 或者: from katello.client.api.custom_info.CustomInfoAPI import update_custom_info [as 别名]
def run(self):
org_name = self.get_option('org')
env_name = self.get_option('environment')
sys_name = self.get_option('name')
sys_uuid = self.get_option('uuid')
keyname = self.get_option('keyname')
new_value = self.get_option('value')
system = get_system(org_name, sys_name, env_name, sys_uuid)
custom_info_api = CustomInfoAPI()
response = custom_info_api.update_custom_info("system", system['id'], keyname, new_value)
ident = sys_uuid if sys_uuid else sys_name
test_record(response,
_("Successfully updated Custom Information [ %s ] for System [ %s ]") % (keyname, ident),
_("Could not update Custom Information [ %s ] for System [ %s ]") % (keyname, ident)
)
示例3: run
# 需要导入模块: from katello.client.api.custom_info import CustomInfoAPI [as 别名]
# 或者: from katello.client.api.custom_info.CustomInfoAPI import update_custom_info [as 别名]
def run(self):
org_name = self.get_option('org')
env_name = self.get_option('environment')
sys_name = self.get_option('name')
sys_uuid = self.get_option('uuid')
keyname = self.get_option('keyname')
current_value = self.get_option('current-value')
new_value = self.get_option('new-value')
system = get_system(org_name, sys_name, env_name, sys_uuid)
custom_info_api = CustomInfoAPI()
response = custom_info_api.update_custom_info("system", system['id'], keyname, current_value, new_value)
ident = sys_uuid if sys_uuid else sys_name
if response[keyname][0] == new_value:
print _("Successfully updated Custom Information for System [ %s ]") % ident
else:
print _("Could not update Custom Information for System [ %s ]") % ident
示例4: run
# 需要导入模块: from katello.client.api.custom_info import CustomInfoAPI [as 别名]
# 或者: from katello.client.api.custom_info.CustomInfoAPI import update_custom_info [as 别名]
def run(self):
org_name = self.get_option('org')
env_name = self.get_option('environment')
dist_name = self.get_option('name')
dist_uuid = self.get_option('uuid')
keyname = self.get_option('keyname')
new_value = self.get_option('value')
distributor = get_distributor(org_name, dist_name, env_name, dist_uuid)
custom_info_api = CustomInfoAPI()
response = custom_info_api.update_custom_info("distributor", distributor['id'], keyname, new_value)
ident = dist_uuid if dist_uuid else dist_name
test_record(response,
_("Successfully updated Custom Information [ %(keyname)s ] for Distributor [ %(ident)s ]") \
% {'keyname':keyname, 'ident':ident},
_("Could not update Custom Information [ %(keyname)s ] for Distributor [ %(ident)s ]") \
% {'keyname':keyname, 'ident':ident}
)
示例5: run
# 需要导入模块: from katello.client.api.custom_info import CustomInfoAPI [as 别名]
# 或者: from katello.client.api.custom_info.CustomInfoAPI import update_custom_info [as 别名]
def run(self):
org_name = self.get_option('org')
env_name = self.get_option('environment')
sys_name = self.get_option('name')
sys_uuid = self.get_option('uuid')
keyname = self.get_option('keyname')
new_value = self.get_option('value')
system = get_system(org_name, sys_name, env_name, sys_uuid)
custom_info_api = CustomInfoAPI()
response = custom_info_api.update_custom_info("system", system['id'], keyname, new_value)
ident = sys_uuid if sys_uuid else sys_name
if response:
print _("Successfully updated Custom Information [ %(keyname)s ] for System [ %(ident)s ]") \
% {'keyname':keyname, 'ident':ident}
else:
print _("Could not update Custom Information [ %(keyname)s ] for System [ %(ident)s ]") \
% {'keyname':keyname, 'ident':ident}