当前位置: 首页>>代码示例>>Python>>正文


Python CustomInfoAPI.update_custom_info方法代码示例

本文整理汇总了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,
            }
开发者ID:AsherBond,项目名称:katello,代码行数:28,代码来源:system_custom_info.py

示例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)
        )
开发者ID:AdamSaleh,项目名称:katello,代码行数:22,代码来源:system_custom_info.py

示例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
开发者ID:gstoeckel,项目名称:katello,代码行数:23,代码来源:system_custom_info.py

示例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}
        )
开发者ID:AsherBond,项目名称:katello,代码行数:24,代码来源:distributor_custom_info.py

示例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}
开发者ID:lzap,项目名称:katello,代码行数:24,代码来源:system_custom_info.py


注:本文中的katello.client.api.custom_info.CustomInfoAPI.update_custom_info方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。