X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sface%2Fsfiprocess.py;h=f794c63974ecb767f9d9bc49d09f02505dde24e0;hb=70e72bd79510c31811477e09f9b98bae94b10362;hp=6f2140be5149a09142ec930ab8196105563433d1;hpb=ee759096e835ee81c1a66759396cd2ad9c3c4001;p=sface.git diff --git a/sface/sfiprocess.py b/sface/sfiprocess.py index 6f2140b..f794c63 100644 --- a/sface/sfiprocess.py +++ b/sface/sfiprocess.py @@ -41,6 +41,9 @@ class SfiProcess(QObject): def __init_command(self, args): self.args = QStringList() + self.args << "-d" + self.args << config.get_dirname() + if config.debug: # this shows xmlrpc conversation, see sfi.py docs. self.args << QString('-D') @@ -105,6 +108,27 @@ class SfiProcess(QObject): # def getRSpecFromAM(self): # return self.__getRSpec(config.getAggmgr()) + def listRecords(self, hrn, rectype=None, filename=None): + args = ["-u", config.getUser(), "-a", config.getAuthority(), + "-r", config.getRegistry(), "-s", config.getSlicemgr(), "list", hrn] + + if filename: + # we can't tell whether SFI will create one file or many, so delete + # leftovers from last time, then we'll know what we got, after we get it. + if os.path.exists(filename): + os.remove(filename) + if os.path.exists(filename + ".1"): + os.remove(filename + ".1") + args.append("-o") + args.append(filename) + + if rectype: + args.append("-t") + args.append(rectype) + + self.__init_command(args) + self.start() + def getRecord(self, hrn, filename=None): args = ["-u", config.getUser(), "-a", config.getAuthority(), "-r", config.getRegistry(), "-s", config.getSlicemgr(), "show", hrn] @@ -114,6 +138,12 @@ class SfiProcess(QObject): self.__init_command(args) self.start() + def getSliceRecord(self): + self.getRecord(config.getSlice(), config.getSliceRecordFile()) + + def getAuthorityRecord(self): + self.getRecord(config.getAuthority(), config.getAuthorityRecordFile()) + def applyRSpec(self, rspec): filename = config.getSliceRSpecFile() + "_new" rspec.save(filename) @@ -130,6 +160,12 @@ class SfiProcess(QObject): self.__init_command(args) self.start() + def addRecord(self, filename): + args = ["-u", config.getUser(), "-a", config.getAuthority(), + "-r", config.getRegistry(), "-s", config.getSlicemgr(), "add", filename] + self.__init_command(args) + self.start() + def renewSlivers(self, expiration): args = ["-u", config.getUser(), "-a", config.getAuthority(), "-r", config.getRegistry(), "-s", config.getSlicemgr(), "renew",