本文整理汇总了Python中mmc.support.mmctools.xmlrpcCleanup函数的典型用法代码示例。如果您正苦于以下问题:Python xmlrpcCleanup函数的具体用法?Python xmlrpcCleanup怎么用?Python xmlrpcCleanup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xmlrpcCleanup函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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))
示例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))
示例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)
示例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))
示例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))
示例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))
示例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))
示例8: get_pull_targets
def get_pull_targets(self):
"""
Returns list of Pull target UUIDs
@return: list
"""
return xmlrpcCleanup(MscDatabase().getPullTargets())
示例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)
示例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])
示例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)
示例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)
示例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)
示例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),
)
)
示例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))