X-Git-Url: http://git.onelab.eu/?p=sface.git;a=blobdiff_plain;f=sface%2Fsfiprocess.py;h=35f0ca9d8650f7a8df42ffd12390bf6e1641e221;hp=3c14718575c8026e32de1b987761abab18ae177e;hb=d7a2606ffd441335cd25b0185cb077c6cb91e795;hpb=96ec1c38a62466c4d69a57835d470fee98a39edc diff --git a/sface/sfiprocess.py b/sface/sfiprocess.py index 3c14718..35f0ca9 100644 --- a/sface/sfiprocess.py +++ b/sface/sfiprocess.py @@ -64,7 +64,15 @@ class SfiProcess(QObject): output = self.process.readAllStandardOutput() self.output = self.output + output if config.debug: - print output + try: + print output + except IOError, e: + if (e.errno == 4): + # XXX why is this happening?? + print "*** caught EINTR" + else: + raise + def processStandardError(self): print self.process.readAllStandardError() @@ -175,7 +183,7 @@ class SfiProcess(QObject): def getAuthorityRecord(self): self.getRecord(config.getAuthority(), config.getAuthorityRecordFile()) - def applyRSpec(self, rspec): + def applyRSpec(self, rspec, aggAddr=None, aggPort=None, saveObtained=True): # that's what we pass, like in what we'd like to get requested = config.getSliceRSpecFile() + "_new" # that's what we actually receive @@ -183,9 +191,31 @@ class SfiProcess(QObject): obtained = config.getSliceRSpecFile() rspec.save(requested) args = ["-u", config.getUser(), "-a", config.getAuthority(), - "-r", config.getRegistry(), "-s", config.getSlicemgr(), "create", - "-o", obtained, - config.getSlice(), requested] + "-r", config.getRegistry(), "-s", config.getSlicemgr(), "create"] + + if saveObtained: + args = args + ["-o", obtained] + + if aggAddr: + args = args + ["-a", aggAddr, "-p", str(aggPort)] + + args = args + [config.getSlice(), requested] + + self.__init_command(args) + self.start() + + def deleteSlivers(self, slice=None, aggAddr=None, aggPort=None): + if not slice: + slice = config.getSlice() + + args = ["-u", config.getUser(), "-a", config.getAuthority(), + "-r", config.getRegistry(), "-s", config.getSlicemgr(), "delete"] + + if aggAddr: + args = args + ["-a", aggAddr, "-p", str(aggPort)] + + args = args + [slice] + self.__init_command(args) self.start() @@ -230,6 +260,15 @@ class SfiProcess(QObject): self.__init_command(args) self.start() + def getSliceMgrVersion(self, filename=None): + if not filename: + filename = config.fullpath("slicemgr.version") + + args = ["-u", config.getUser(), "-a", config.getAuthority(), + "-r", config.getRegistry(), "-s", config.getSlicemgr(), "version", + "-o", filename, "-F", "pickled",] + self.__init_command(args) + self.start() def start(self): self.respones = []