- def private_key_filename (self):
- return self.fullpath ("%s.pkey" % Xrn.unescape(self.hrn))
- def self_signed_cert_filename (self):
- return self.fullpath ("%s.sscert"%self.hrn)
- def my_credential_filename (self):
- return self.credential_filename (self.hrn, "user")
- def credential_filename (self, hrn, type):
- return self.fullpath ("%s.%s.cred"%(hrn,type))
- def slice_credential_filename (self, hrn):
- return self.credential_filename(hrn,'slice')
- def authority_credential_filename (self, hrn):
- return self.credential_filename(hrn,'authority')
- def my_gid_filename (self):
- return self.gid_filename (self.hrn, "user")
- def gid_filename (self, hrn, type):
- return self.fullpath ("%s.%s.gid"%(hrn,type))
- def my_pkcs12_filename (self):
- return self.fullpath ("%s.p12"%self.hrn)
+ def private_key_filename(self):
+ return self.fullpath("{}.pkey".format(Xrn.unescape(self.hrn)))
+
+ def self_signed_cert_filename(self):
+ return self.fullpath("{}.sscert".format(self.hrn))
+
+ def my_credential_filename(self):
+ return self.credential_filename(self.hrn, "user")
+ # the tests use sfi -u <pi-user>; meaning that the slice credential filename
+ # needs to keep track of the user too
+
+ def credential_filename(self, hrn, type):
+ if type in ['user']:
+ basename = "{}.{}.cred".format(hrn, type)
+ else:
+ basename = "{}-{}.{}.cred".format(self.hrn, hrn, type)
+ return self.fullpath(basename)
+
+ def slice_credential_filename(self, hrn):
+ return self.credential_filename(hrn, 'slice')
+
+ def authority_credential_filename(self, hrn):
+ return self.credential_filename(hrn, 'authority')
+
+ def my_gid_filename(self):
+ return self.gid_filename(self.hrn, "user")
+
+ def gid_filename(self, hrn, type):
+ return self.fullpath("{}.{}.gid".format(hrn, type))
+
+ def my_pkcs12_filename(self):
+ return self.fullpath("{}.p12".format(self.hrn))