+ def release(self):
+ """
+ Remove hosts from the reserved and blacklist lists, and in case
+ the persist attribute is set, it saves the blacklisted hosts
+ in the blacklist file.
+ """
+ self.apis -= 1
+ if self.apis == 0:
+ blacklist = self._blacklist
+ self._blacklist = set()
+ self._reserved = set()
+# if self._ecobj.get_global('PlanetlabSfaNode', 'persist_blacklist'):
+# if blacklist:
+# to_blacklist = list()
+# hostnames = self.get_nodes(list(blacklist), ['hostname'])
+# for hostname in hostnames:
+# to_blacklist.append(hostname['hostname'])
+#
+# nepi_home = os.path.join(os.path.expanduser("~"), ".nepi")
+# plblacklist_file = os.path.join(nepi_home, "plblacklist.txt")
+#
+# with open(plblacklist_file, 'w') as f:
+# for host in to_blacklist:
+# f.write("%s\n" % host)
+#
+
+