- # Several aggregates have issues with the <statistics> section in the
- # rspec, so make sure it's not there.
- stats_elems = rspec.xml.xpath("//statistics")
- if len(stats_elems)>0:
- stats_elem = stats_elems[0]
- parent = stats_elem.xpath("..")[0]
- parent.remove(stats_elem)
-
- self.submit_aggSuccessCount = 0
- self.submit_aggFailCount = 0
- self.submit_rspec = rspec
- self.connect(self.process, SIGNAL('finished()'), self.getVersionFinished)
- self.process.getSliceMgrVersion()
- self.setStatus("Getting aggregate directory...")
-
- def getVersionFinished(self):
- self.disconnect(self.process, SIGNAL('finished()'), self.getVersionFinished)
-
- faultString = self.process.getFaultString()
- if not faultString:
- peers = SfiData().getSliceMgrVersion()["peers"]
- self.submit_aggs = [(key, peers[key]) for key in peers.keys()]
- str = "<font color='green'>Successfully retrieved agg list.</font> "
- self.submitNextAgg(str)
- else:
- self.setStatus("<font color='red'>getSliceMgrVersion failed: %s</font>" % (faultString))
-
- def submitNextAgg(self, statusStr=""):
- if (self.submit_aggs == []):
- self.setStatus(statusStr + "<font color='green'>Finished submitting. %d/%d aggs succeeded.</font>" %
- (self.submit_aggSuccessCount,self.submit_aggSuccessCount+self.submit_aggFailCount))
- QTimer.singleShot(2500, self.refresh)