specify -t --type option when calling sfi show
[sface.git] / sface / sfirenew.py
index dda2652..8d15ba5 100644 (file)
@@ -21,7 +21,7 @@ class SfiRenewer(QObject):
 
         self.renewProcess = SfiProcess(self)
         self.connect(self.renewProcess, SIGNAL('finished()'), self.finishedGetRecord)
-        self.renewProcess.getRecord(hrn=hrn, filename="/tmp/slicerecord")
+        self.renewProcess.getRecord(hrn=hrn, type="slice", filename="/tmp/slicerecord")
 
     def finishedGetRecord(self):
         self.faultString = self.renewProcess.getFaultString()
@@ -63,12 +63,17 @@ class SfiRenewer(QObject):
         if os.path.exists(sliceCredName):
             os.remove(sliceCredName)
 
+        # newer SFA has a slightly different slice credential name
+        sliceCredName = config.fullpath(self.hrn + ".slice.cred")
+        if os.path.exists(sliceCredName):
+            os.remove(sliceCredName)
+
         open("/tmp/expiration", "w").write(self.newExpiration.strftime("%Y-%m-%dT%H:%M:%SZ"))
 
         # call renewSlivers on the aggregate
         self.disconnect(self.renewProcess, SIGNAL('finished()'), self.finishedUpdateRecord)
         self.connect(self.renewProcess, SIGNAL('finished()'), self.finishedRenewSlivers)
-        self.renewProcess.renewSlivers(self.newExpiration.strftime("%Y-%m-%dT%H:%M:%SZ"))
+        self.renewProcess.renewSlivers(self.newExpiration.strftime("%Y-%m-%dT%H:%M:%SZ"), slice = self.hrn)
 
     def finishedRenewSlivers(self):
         self.faultString = self.renewProcess.getFaultString()