+# remove slice or key
+def remove_slice(name):
+ cmdremove = "sfaadmin.py reg remove {0}".format(name)
+ removeaction = subprocess.Popen(cmdremove, shell=True)
+
+# show specific credential of a slice
+def show_slice_credential(slice_name):
+ path = "/root/.sfi/{0}.slice.cred".format(slice_name)
+ tree = ET.parse(path)
+ root = tree.getroot()
+ hash = {}
+# hash["slice_native"] = ET.tostring(root)
+ for target in root.findall('credential'):
+ hash["slice_user_urn"] = target.find('owner_urn').text
+ hash["slice_urn"] = target.find('target_urn').text
+ hash["slice_native"] = target.find('serial').text
+ return hash
+
+# create a bonfire experiment from a sfa point of view
+def allocate(user_name, groups, description, walltime, slice_name):
+ hash ={}
+ hash = show_slice_credential(slice_name)
+ create_fed4fire_exp(user_name, groups, description, walltime, hash["slice_urn"], hash["slice_user_urn"], hash["slice_native"])
+
+