import os
-from subprocess import call
+import re
+from subprocess import *
from sfa.util.rspecHelper import RSpec
class SfaData:
def setSlice(self, slice):
SfaData.slice = slice
- def getRecord(self):
- pass
+ def getRecord(self, hrn):
+ text = Popen(["sfi.py", "-u", self.getUser(), "-a",
+ self.getAuthority(), "-r", self.registry,
+ "-s", self.slicemgr, "show", hrn],
+ stdout=PIPE).communicate()[0]
+ return text
+
+ def listChildren(self, hrn):
+ children = []
+ text = Popen(["sfi.py", "-u", self.getUser(), "-a",
+ self.getAuthority(), "-r", self.registry,
+ "-s", self.slicemgr, "list", hrn],
+ stdout=PIPE).communicate()[0]
+ lines = text.split('\n')
+ for line in lines:
+ if line:
+ (hrn, kind) = line.split()
+ children.append((hrn, kind))
+
+ return children
def getRSpec(self):
slice = self.getSlice()