[haizea-commit] r807 - in branches/1.1/src/haizea/core: . scheduler scheduler/preparation_schedulers
haizea-commit at mailman.cs.uchicago.edu
haizea-commit at mailman.cs.uchicago.edu
Tue Jun 22 13:34:55 CDT 2010
Author: borja
Date: 2010-06-22 13:34:55 -0500 (Tue, 22 Jun 2010)
New Revision: 807
Modified:
branches/1.1/src/haizea/core/leases.py
branches/1.1/src/haizea/core/scheduler/preparation_schedulers/imagetransfer.py
branches/1.1/src/haizea/core/scheduler/resourcepool.py
branches/1.1/src/haizea/core/scheduler/vm_scheduler.py
Log:
Minor fixes
Modified: branches/1.1/src/haizea/core/leases.py
===================================================================
--- branches/1.1/src/haizea/core/leases.py 2010-06-22 18:33:47 UTC (rev 806)
+++ branches/1.1/src/haizea/core/leases.py 2010-06-22 18:34:55 UTC (rev 807)
@@ -1431,20 +1431,20 @@
self.attributes = attributes
def __apply_to_lease(self, lease, annotation):
- if annotation.start != None:
- if annotation.start.requested in (Timestamp.NOW, Timestamp.UNSPECIFIED):
- lease.start.requested = annotation.start.requested
- else:
- lease.start.requested = lease.submit_time + annotation.start.requested
+ if annotation.start != None:
+ if annotation.start.requested in (Timestamp.NOW, Timestamp.UNSPECIFIED):
+ lease.start.requested = annotation.start.requested
+ else:
+ lease.start.requested = lease.submit_time + annotation.start.requested
- if annotation.deadline != None:
- lease.deadline = lease.submit_time + annotation.deadline
+ if annotation.deadline != None:
+ lease.deadline = lease.submit_time + annotation.deadline
- if annotation.software != None:
- lease.software = annotation.software
+ if annotation.software != None:
+ lease.software = annotation.software
- if annotation.extras != None:
- lease.extras.update(annotation.extras)
+ if annotation.extras != None:
+ lease.extras.update(annotation.extras)
def apply_to_leases(self, leases):
"""Apply annotations to a workload
@@ -1486,7 +1486,7 @@
if annotation.lease_id == None:
annotations_list.append(annotation)
else:
- annotations_dict[annotation.lease_id] = annotation
+ annotations_dict[int(annotation.lease_id)] = annotation
attributes = {}
attributes_elem = element.find("attributes")
@@ -1500,7 +1500,7 @@
annotations = annotations_dict
elif len(annotations_dict) == 0:
annotations = annotations_list
-
+
return cls(annotations, attributes)
def to_xml(self):
Modified: branches/1.1/src/haizea/core/scheduler/preparation_schedulers/imagetransfer.py
===================================================================
--- branches/1.1/src/haizea/core/scheduler/preparation_schedulers/imagetransfer.py 2010-06-22 18:33:47 UTC (rev 806)
+++ branches/1.1/src/haizea/core/scheduler/preparation_schedulers/imagetransfer.py 2010-06-22 18:34:55 UTC (rev 807)
@@ -196,7 +196,7 @@
for t in toremove:
t.lease.remove_preparationrr(t)
self.slottable.remove_reservation(t)
- self.__remove_files(lease)
+ #self.__remove_files(lease)
def cleanup(self, lease):
self.__remove_files(lease)
Modified: branches/1.1/src/haizea/core/scheduler/resourcepool.py
===================================================================
--- branches/1.1/src/haizea/core/scheduler/resourcepool.py 2010-06-22 18:33:47 UTC (rev 806)
+++ branches/1.1/src/haizea/core/scheduler/resourcepool.py 2010-06-22 18:34:55 UTC (rev 807)
@@ -154,7 +154,6 @@
def remove_diskimage(self, pnode, lease, vnode):
node = self.get_node(pnode)
node.print_files()
-
self.logger.debug("Removing disk image for L%iV%i in node %i" % (lease, vnode, pnode))
node.remove_diskimage(lease, vnode)
Modified: branches/1.1/src/haizea/core/scheduler/vm_scheduler.py
===================================================================
--- branches/1.1/src/haizea/core/scheduler/vm_scheduler.py 2010-06-22 18:33:47 UTC (rev 806)
+++ branches/1.1/src/haizea/core/scheduler/vm_scheduler.py 2010-06-22 18:34:55 UTC (rev 807)
@@ -1318,9 +1318,10 @@
lease_state = l.get_state()
- if not self.resourcepool.verify_deploy(l, rr):
- self.logger.error("Deployment was not complete.")
- raise # TODO raise something better
+ if get_config().get("lease-preparation") == "imagetransfer":
+ if not self.resourcepool.verify_deploy(l, rr):
+ self.logger.error("Deployment was not complete.")
+ raise # TODO raise something better
# Kludge: Should be done by the preparations scheduler
if l.get_state() == Lease.STATE_SCHEDULED:
More information about the Haizea-commit
mailing list