Skip to content
This repository
Browse code

local tests passed. issues with ec2 still need to be ironed out.

  • Loading branch information...
commit 9d00c19ba3385f6e2b1ec9f2835a6ca36d88299a 1 parent f625ce6
authored March 10, 2011
2  cloudinitd/bootfabtasks.py
@@ -72,5 +72,5 @@ def bootpgm(pgm=None, conf=None, output=None):
72 72
             pass
73 73
 
74 74
 def fetch_conf(output=None):
75  
-    remote_output = "%s/bootout.json" % REMOTE_WORKING_DIR
  75
+    remote_output = "%s/bootout.json" % (REMOTE_WORKING_DIR)
76 76
     get(remote_output, output) 
24  cloudinitd/cb_iaas.py
@@ -81,7 +81,12 @@ def __init__(self, con):
81 81
         self._con = con
82 82
 
83 83
     def get_all_instances(self, instance_ids=None):
84  
-        pass
  84
+        nodes = conn.list_nodes()
  85
+        if instance_ids:
  86
+            nodes = [IaaSLibCloudInstance(n) for n in nodes if n.name in instance_ids]
  87
+        else:
  88
+            nodes = [IaaSLibCloudInstance(n) for n in nodes]
  89
+        return nodes
85 90
 #        name	String with a name for this new node (required) (type: str )#
86 91
 	#size	The size of resources allocated to this node. (required) (type: NodeSize )
87 92
 	#image	OS Image to boot on node. (required) (type: NodeImage )
@@ -92,7 +97,8 @@ def run_instance(self, image, instance_type, key_name, security_groupname=None):
92 97
         pass
93 98
 
94 99
     def find_instance(self, instance_id):
95  
-        pass
  100
+        i_a = self.get_all_instances([instance_id,])
  101
+        return i_a[0]
96 102
 
97 103
 class IaaSTestInstance(object):
98 104
 
@@ -156,23 +162,23 @@ def get_id(self):
156 162
 
157 163
 class IaaSLibCloudInstance(object):
158 164
 
159  
-    def __init__(self, instance):
160  
-        self._instance = instance
  165
+    def __init__(self, node):
  166
+        self._node = node
161 167
 
162 168
     def terminate(self):
163  
-        return self._instance.terminate()
  169
+        pass
164 170
 
165 171
     def update(self):
166  
-        return self._instance.update()
  172
+        pass
167 173
 
168 174
     def get_hostname(self):
169  
-        return self._instance.public_dns_name
  175
+        pass
170 176
 
171 177
     def get_state(self):
172  
-        return self._instance.state
  178
+        pass
173 179
 
174 180
     def get_id(self):
175  
-        return self._instance.id
  181
+        pass
176 182
 
177 183
 
178 184
 def iaas_get_con(key, secret, iaashostname=None, iaasport=None, iaas="us-east-1"):

0 notes on commit 9d00c19

Please sign in to comment.
Something went wrong with that request. Please try again.