• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python mmctools.xmlrpcCleanup函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中mmc.support.mmctools.xmlrpcCleanup函数的典型用法代码示例。如果您正苦于以下问题:Python xmlrpcCleanup函数的具体用法?Python xmlrpcCleanup怎么用?Python xmlrpcCleanup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了xmlrpcCleanup函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: replyToQuery

def replyToQuery(ctx, query, bool = None, min = 0, max = 10, justId = False, toH = False, filt = None):
    if query == None: return []
    if __onlyIn(query, ComputerManager().main):
        ComputerManager().main
        filt = __addCtxFilters(ctx, filt)
        filt['query'] = query
        return xmlrpcCleanup(ComputerManager().getRestrictedComputersList(ctx, min, max, filt, False, justId, toH))
    else:
        return xmlrpcCleanup(QueryManager().replyToQuery(ctx, query, bool, min, max))
开发者ID:zentyal,项目名称:mmc,代码行数:9,代码来源:__init__.py


示例2: replyToQueryLen

def replyToQueryLen(ctx, query, bool = None, filt = None):
    if query == None: return 0
    if __onlyIn(query, ComputerManager().main):
        ComputerManager().main
        filt = __addCtxFilters(ctx, filt)
        filt['query'] = query
        return xmlrpcCleanup(ComputerManager().getRestrictedComputersListLen(ctx, filt))
    else:
        return xmlrpcCleanup(QueryManager().replyToQueryLen(ctx, query, bool))
开发者ID:zentyal,项目名称:mmc,代码行数:9,代码来源:__init__.py


示例3: get_group

 def get_group(self, id, ro=False, root_context=False):
     grp = DyngroupDatabase().get_group(self.getContext(), id)
     if grp.type == 2:
         _group_user = DyngroupDatabase()._get_group_user(grp.parent_id)
         ctx = self.getContext(user=_group_user)
     else:
         ctx = root_context and self.getContext() or self.currentContext
     grp = DyngroupDatabase().get_group(ctx, id, ro)
     if grp:
         return xmlrpcCleanup(grp.toH())
     return xmlrpcCleanup(False)
开发者ID:AnatomicJC,项目名称:mmc,代码行数:11,代码来源:__init__.py


示例4: setbool_group

 def setbool_group(self, id, bool, type=0, parent_id=None):
     if type == 2 and parent_id is not None: # convergence group, get parent group's user context
         _group_user = DyngroupDatabase()._get_group_user(parent_id)
         ctx = self.getContext(user=_group_user)
     else:
         ctx = self.currentContext
     return xmlrpcCleanup(DyngroupDatabase().setbool_group(ctx, id, bool))
开发者ID:AnatomicJC,项目名称:mmc,代码行数:7,代码来源:__init__.py


示例5: inventoryExists

    def inventoryExists(self, uuid):
        ctx = self.currentContext
        if uuid == '':
            return False
#        if not ComputerLocationManager().doesUserHaveAccessToMachine(ctx.userid, uuid):
#            return False
        return xmlrpcCleanup(Inventory().inventoryExists(ctx, uuid))
开发者ID:tekmans,项目名称:mmc,代码行数:7,代码来源:__init__.py


示例6: delete_group

 def delete_group(self, id):
     ctx = self.currentContext
     if self.isprofile(id):
         grp = DyngroupDatabase().get_group(ctx, id, True)
         profile_UUID = grp.getUUID()
         ComputerProfileManager().delProfile(profile_UUID)
     return xmlrpcCleanup(DyngroupDatabase().delete_group(ctx, id))
开发者ID:zentyal,项目名称:mmc,代码行数:7,代码来源:__init__.py


示例7: create_group

 def create_group(self, name, visibility, type=0, parent_id=None):
     if type == 2 and parent_id is not None: # convergence group, get parent group's user context
         _group_user = DyngroupDatabase()._get_group_user(parent_id)
         ctx = self.getContext(user=_group_user)
     else:
         ctx = self.currentContext
     return xmlrpcCleanup(DyngroupDatabase().create_group(ctx, name, visibility, type, parent_id))
开发者ID:zentyal,项目名称:mmc,代码行数:7,代码来源:__init__.py


示例8: get_pull_targets

    def get_pull_targets(self):
        """
        Returns list of Pull target UUIDs

        @return: list
        """
        return xmlrpcCleanup(MscDatabase().getPullTargets())
开发者ID:inkhey,项目名称:mmc,代码行数:7,代码来源:__init__.py


示例9: reload_group

    def reload_group(self, id):
        ctx = self.currentContext
        ret = DyngroupDatabase().reload_group(ctx, id, queryManager)
        # WIP : call ComputerProfileManager to add machines
#        if self.isprofile(id):
#            ComputerProfileManager().addComputersToProfile(ctx, [1, 2], id) # fake!
        return xmlrpcCleanup(ret)
开发者ID:zentyal,项目名称:mmc,代码行数:7,代码来源:__init__.py


示例10: addmembers_to_group

    def addmembers_to_group(self, id, uuids):
        ctx = self.currentContext
        # remove all the computers that cant be added to a profile from the list
        didnt_work = []
        are_some_to_remove = False
        if self.isprofile(id):
            computers = []
            uuid2key = {}
            for c in uuids:
                computers.append(uuids[c]['uuid'])
                uuid2key[uuids[c]['uuid']] = c
            didnt_work = ComputerProfileManager().areForbiddebComputers(computers)

            if len(didnt_work) > 0:
                logging.getLogger().debug("Can't add the following computers in that profile %s : %s"%(str(id), str(didnt_work)))
                for i in didnt_work:
                    if uuid2key[i] in uuids:
                        are_some_to_remove = True
                        uuids.pop(uuid2key[i])

        if len(uuids) != 0:
            if self.isprofile(id):
                ComputerProfileManager().addComputersToProfile(ctx, uuids, id)
            else:
                ret = DyngroupDatabase().addmembers_to_group(ctx, id, uuids)
                return [ret]
        return xmlrpcCleanup([not are_some_to_remove, didnt_work])
开发者ID:zentyal,项目名称:mmc,代码行数:27,代码来源:__init__.py


示例11: delmembers_to_group

 def delmembers_to_group(self, id, uuids):
     ctx = self.currentContext
     ret = DyngroupDatabase().delmembers_to_group(ctx, id, uuids)
     # WIP : call ComputerProfileManager to add machines
     if len(uuids) != 0 and self.isprofile(id):
         ComputerProfileManager().delComputersFromProfile(uuids, id)
     return xmlrpcCleanup(ret)
开发者ID:zentyal,项目名称:mmc,代码行数:7,代码来源:__init__.py


示例12: get_profile_imaging_server

 def get_profile_imaging_server(self, gid):
     if gid == '':
         return False
     if not self.isprofile(gid):
         return False
     ret = DyngroupDatabase().getProfileImagingServer(gid)
     return xmlrpcCleanup(ret)
开发者ID:zentyal,项目名称:mmc,代码行数:7,代码来源:__init__.py


示例13: get_profile_entity

 def get_profile_entity(self, gid):
     if gid == '':
         return False
     if not self.isprofile(gid):
         return False
     ret = DyngroupDatabase().getProfileEntity(gid)
     return xmlrpcCleanup(ret)
开发者ID:zentyal,项目名称:mmc,代码行数:7,代码来源:__init__.py


示例14: getMachinesByDict

 def getMachinesByDict(self, table, params):
     ctx = self.currentContext
     return xmlrpcCleanup(
         map(
             lambda m: ComputerLocationManager().doesUserHaveAccessToMachine(ctx.userid, m[0]),
             Inventory().getMachinesByDict(ctx, table, params),
         )
     )
开发者ID:pavelpromin,项目名称:mmc,代码行数:8,代码来源:__init__.py


示例15: establish_vnc_proxy

 def establish_vnc_proxy(self, scheduler, uuid, requestor_ip):
     ctx = self.currentContext
     computer = ComputerManager().getComputer(ctx, {'uuid': uuid})
     try: # FIXME: dirty bugfix, should be factorized upstream
         computer[1]['fullname']
     except KeyError:
         computer[1]['fullname'] = computer[1]['cn'][0]
     return xmlrpcCleanup(mmc.plugins.msc.client.scheduler.tcp_sproxy(scheduler, computer, requestor_ip, MscConfig().web_vnc_port))
开发者ID:tekmans,项目名称:mmc,代码行数:8,代码来源:__init__.py


示例16: is_pull_target

    def is_pull_target(self, uuid):
        """
        Returns True if the machine is a known pull client

        @param uuid: computer UUID
        @type uuid: str

        @return: bool
        """
        return xmlrpcCleanup(MscDatabase().isPullTarget(uuid))
开发者ID:inkhey,项目名称:mmc,代码行数:10,代码来源:__init__.py


示例17: getPossiblesValuesForCriterionInModuleFuzzyWhere

 def getPossiblesValuesForCriterionInModuleFuzzyWhere(self, moduleName, criterion, value1, value2 = ''): # not used anymore ?
     ctx = self.currentContext
     if not isDynamicEnable():
         return False
     result = queryManager.getPossiblesValuesForCriterionInModule(ctx, moduleName, criterion, unescape(value1), unescape(value2))
     ret = result[1]
     # Only returns the 100 first results
     # FIXME: maybe the range limitation could be done on the queryManager ?
     ret = ret[:100]
     return xmlrpcCleanup(ret)
开发者ID:tekmans,项目名称:mmc,代码行数:10,代码来源:__init__.py


示例18: update_target_ip

    def update_target_ip(self, uuid, ip):
        """
        Updates IP address of all records according to UUID.

        @param uuid: UUID of machine
        @type uuid: str

        @param ip: actualized IP address of machine
        @type ip: str
        """
        return xmlrpcCleanup(MscDatabase().updateTargetIP(uuid, ip))
开发者ID:inkhey,项目名称:mmc,代码行数:11,代码来源:__init__.py


示例19: remove_pull_targets

    def remove_pull_targets(self, uuids):
        """
        remove pull targets
        @param uuids: a list of uuids to remove
        @type uuids: list or str

        @return: True or False :-)
        """
        if isinstance(uuids, basestring):
            uuids = [uuids]
        return xmlrpcCleanup(MscDatabase().removePullTargets(uuids))
开发者ID:inkhey,项目名称:mmc,代码行数:11,代码来源:__init__.py


示例20: checkLightPullCommands

    def checkLightPullCommands(self, uuid):
        """
        Returns all coh ids te re-execute.

        @param uuid: uuid of checked computer
        @type uuid: str

        @return: coh ids to start
        @rtype: list
        """
        return xmlrpcCleanup(MscDatabase().checkLightPullCommands(uuid))
开发者ID:inkhey,项目名称:mmc,代码行数:11,代码来源:__init__.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python mmctools.SecurityContext类代码示例发布时间:2022-05-27
下一篇:
Python config.PluginConfig类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap