Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Commit

Permalink
local tests passed. issues with ec2 still need to be ironed out.
Browse files Browse the repository at this point in the history
  • Loading branch information
BuzzTroll committed Mar 10, 2011
1 parent f625ce6 commit 9d00c19
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cloudinitd/bootfabtasks.py
Expand Up @@ -72,5 +72,5 @@ def bootpgm(pgm=None, conf=None, output=None):
pass pass


def fetch_conf(output=None): def fetch_conf(output=None):
remote_output = "%s/bootout.json" % REMOTE_WORKING_DIR remote_output = "%s/bootout.json" % (REMOTE_WORKING_DIR)
get(remote_output, output) get(remote_output, output)
24 changes: 15 additions & 9 deletions cloudinitd/cb_iaas.py
Expand Up @@ -81,7 +81,12 @@ def __init__(self, con):
self._con = con self._con = con


def get_all_instances(self, instance_ids=None): def get_all_instances(self, instance_ids=None):
pass nodes = conn.list_nodes()
if instance_ids:
nodes = [IaaSLibCloudInstance(n) for n in nodes if n.name in instance_ids]
else:
nodes = [IaaSLibCloudInstance(n) for n in nodes]
return nodes
# name String with a name for this new node (required) (type: str )# # name String with a name for this new node (required) (type: str )#
#size The size of resources allocated to this node. (required) (type: NodeSize ) #size The size of resources allocated to this node. (required) (type: NodeSize )
#image OS Image to boot on node. (required) (type: NodeImage ) #image OS Image to boot on node. (required) (type: NodeImage )
Expand All @@ -92,7 +97,8 @@ def run_instance(self, image, instance_type, key_name, security_groupname=None):
pass pass


def find_instance(self, instance_id): def find_instance(self, instance_id):
pass i_a = self.get_all_instances([instance_id,])
return i_a[0]


class IaaSTestInstance(object): class IaaSTestInstance(object):


Expand Down Expand Up @@ -156,23 +162,23 @@ def get_id(self):


class IaaSLibCloudInstance(object): class IaaSLibCloudInstance(object):


def __init__(self, instance): def __init__(self, node):
self._instance = instance self._node = node


def terminate(self): def terminate(self):
return self._instance.terminate() pass


def update(self): def update(self):
return self._instance.update() pass


def get_hostname(self): def get_hostname(self):
return self._instance.public_dns_name pass


def get_state(self): def get_state(self):
return self._instance.state pass


def get_id(self): def get_id(self):
return self._instance.id pass




def iaas_get_con(key, secret, iaashostname=None, iaasport=None, iaas="us-east-1"): def iaas_get_con(key, secret, iaashostname=None, iaasport=None, iaas="us-east-1"):
Expand Down

0 comments on commit 9d00c19

Please sign in to comment.