Fix get resources for slices
authorTony Mack <tmack@paris.CS.Princeton.EDU>
Sat, 4 Feb 2012 03:30:16 +0000 (22:30 -0500)
committerTony Mack <tmack@paris.CS.Princeton.EDU>
Sat, 4 Feb 2012 03:30:16 +0000 (22:30 -0500)
sfa/openstack/nova_shell.py
sfa/openstack/osaggregate.py

index bebe8a8..053fd71 100644 (file)
@@ -45,6 +45,7 @@ class NovaShell:
     def __init__ ( self, config ) :
         url = config.SFA_PLC_URL
         # try to figure if the url is local
+        is_local=False    
         hostname=urlparse(url).hostname
         if hostname == 'localhost': is_local=True
         # otherwise compare IP addresses; 
index 7e6a53d..fb3f17b 100644 (file)
@@ -28,7 +28,7 @@ class OSAggregate:
             # this is an isntance type dict
             name = instance['name']
             type = instance['name'] 
-        elif isinstnace(instance, nova.db.sqlalchemy.models.Instance):
+        elif isinstance(instance, nova.db.sqlalchemy.models.Instance):
             # this is an object that describes a running instance
             name = instance.display_name
             type = instance.instance_type.name
@@ -155,4 +155,12 @@ class OSAggregate:
                     self.driver.shell.db.key_pair_destroy(username, key.name)
             
     def verify_instances(self, slicename, rspec):
-        pass 
+        rsepc = RSpec(rspec)
+        nodes = rspec.version.get_nodes_with_slivers()
+        old_instances = self.driver.shell.db.instance_get_all_by_project(name)
+        for node in nodes:
+            for slivers in node.get('slivers', []):
+                pass
+                # get instance type
+                # get image
+                # start instance