From e1d58b1e78bcde73897466a5677bdc6ba39a4f1b Mon Sep 17 00:00:00 2001 From: smbaker Date: Tue, 23 Aug 2011 18:25:30 -0700 Subject: [PATCH] add methods for getting slice records and listing authority records --- sface/sfiprocess.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/sface/sfiprocess.py b/sface/sfiprocess.py index 6f2140b..829abab 100644 --- a/sface/sfiprocess.py +++ b/sface/sfiprocess.py @@ -105,6 +105,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 +135,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) -- 2.43.0