Exemplo n.º 1
0
 def uuidFilter2(self, package_apis):
     self.package_apis = package_apis
     # warn as we do pop in package retrival but we want to keep the packages
     # in the good order, we need to reverse the package api list order
     self.package_apis.reverse()
     d = MirrorApi().getMirror(self.machine)
     d.addCallbacks(self.uuidFilter3, self.onError)
     d.addErrback(lambda err: self.onError(err))
Exemplo n.º 2
0
 def uuidFilter2(self, package_apis):
     self.package_apis = package_apis
     # warn as we do pop in package retrival but we want to keep the packages
     # in the good order, we need to reverse the package api list order
     self.package_apis.reverse()
     d = MirrorApi().getMirror(self.machine)
     d.addCallbacks(self.uuidFilter3, self.onError)
     d.addErrback(lambda err: self.onError(err))
Exemplo n.º 3
0
 def get(self):
     try:
         self.machine = self.filt["uuid"]
         d = MirrorApi().getApiPackage(self.machine)
         d.addCallbacks(self.uuidFilter2, self.onError)
         d.addErrback(lambda err: self.onError(err))
     except KeyError:
         self.sendResult()
Exemplo n.º 4
0
 def get(self):
     try:
         self.machine = self.filt["uuid"]
         d = MirrorApi().getApiPackage(self.machine)
         d.addCallbacks(self.uuidFilter2, self.onError)
         d.addErrback(lambda err: self.onError(err))
     except KeyError:
         self.sendResult()
Exemplo n.º 5
0
 def get(self):
     try:
         self.gid = self.filt["group"]
     except KeyError:
         self.sendResult()
     if self.gid:
         self.machines = []
         if ComputerGroupManager().isdyn_group(self.ctx, self.gid):
             if ComputerGroupManager().isrequest_group(self.ctx, self.gid):
                 self.machines = ComputerGroupManager().requestresult_group(self.ctx, self.gid, 0, -1, '')
             else:
                 self.machines = ComputerGroupManager().result_group(self.ctx, self.gid, 0, -1, '')
         else:
             self.machines = ComputerGroupManager().result_group(self.ctx, self.gid, 0, -1, '')
         d = MirrorApi().getApiPackages(self.machines)
         d.addCallbacks(self.getMirrors, self.onError)
         d.addErrback(lambda err: self.onError(err))
Exemplo n.º 6
0
 def get(self):
     try:
         self.gid = self.filt["group"]
     except KeyError:
         self.sendResult()
     if self.gid:
         self.machines = []
         if ComputerGroupManager().isdyn_group(self.ctx, self.gid):
             if ComputerGroupManager().isrequest_group(self.ctx, self.gid):
                 self.machines = ComputerGroupManager().requestresult_group(self.ctx, self.gid, 0, -1, '')
             else:
                 self.machines = ComputerGroupManager().result_group(self.ctx, self.gid, 0, -1, '')
         else:
             self.machines = ComputerGroupManager().result_group(self.ctx, self.gid, 0, -1, '')
         d = MirrorApi().getApiPackages(self.machines)
         d.addCallbacks(self.getMirrors, self.onError)
         d.addErrback(lambda err: self.onError(err))
Exemplo n.º 7
0
 def cbGetTargetsFallbackMirrors(mirrors, schedulers):
     args = map(lambda x: {"uuid" : x[0], "name": x[1]}, targets)
     d2 = MirrorApi().getFallbackMirrors(args)
     d2.addCallback(cbCreateTargets, mirrors, schedulers)
     d2.addErrback(lambda err: err)
     return d2
Exemplo n.º 8
0
 def cbGetTargetsMirrors(schedulers):
     args = map(lambda x: {"uuid" : x[0], "name": x[1]}, targets)
     d1 = MirrorApi().getMirrors(args)
     d1.addCallback(cbGetTargetsFallbackMirrors, schedulers)
     d1.addErrback(lambda err: err)
     return d1
Exemplo n.º 9
0
 def getMirrors(self, package_apis):
     self.package_apis = package_apis
     d = MirrorApi().getMirrors(self.machines)
     d.addCallbacks(self.getMirrorsResult, self.onError)
     d.addErrback(lambda err: self.onError(err))
Exemplo n.º 10
0
 def cbGetTargetsFallbackMirrors(mirrors, schedulers):
     args = map(lambda x: {"uuid": x[0], "name": x[1]}, targets)
     d2 = MirrorApi().getFallbackMirrors(args)
     d2.addCallback(cbCreateTargets, mirrors, schedulers)
     d2.addErrback(lambda err: err)
     return d2
Exemplo n.º 11
0
 def cbGetTargetsMirrors(schedulers):
     args = map(lambda x: {"uuid": x[0], "name": x[1]}, targets)
     d1 = MirrorApi().getMirrors(args)
     d1.addCallback(cbGetTargetsFallbackMirrors, schedulers)
     d1.addErrback(lambda err: err)
     return d1
Exemplo n.º 12
0
 def getMirrors(self, package_apis):
     self.package_apis = package_apis
     d = MirrorApi().getMirrors(self.machines)
     d.addCallbacks(self.getMirrorsResult, self.onError)
     d.addErrback(lambda err: self.onError(err))