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

Commit

Permalink
possible solution for gh-28
Browse files Browse the repository at this point in the history
possible solution for group hub bug gh-29
  • Loading branch information
buzztroll committed Aug 12, 2011
1 parent 0c13f0e commit e1cae67
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
11 changes: 3 additions & 8 deletions cloudinitd/cb_iaas.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def _run_instance(self):
if security_groupname:
sec_group_a = self._con.get_all_security_groups(groupnames=[security_groupname,])
if sec_group_a:
sec_group = sec_group_a[0]
sec_group = sec_group_a

reservation = self._con.run_instances(image, instance_type=instance_type, key_name=key_name, security_groups=sec_group)
instance = reservation.instances[0]
Expand Down Expand Up @@ -445,6 +445,7 @@ def _ec2_nimbus_validate(svc, log):
g_validate_funcs = {}
g_validate_funcs['nimbus'] = _iaas_nimbus_validate
g_validate_funcs['ec2'] = _ec2_nimbus_validate
g_validate_funcs['eucalyptus'] = _ec2_nimbus_validate

def iaas_validate(svc, log=logging):
global g_validate_funcs
Expand Down Expand Up @@ -483,10 +484,4 @@ def iaas_validate(svc, log=logging):

return (rc, str(msgs))

def _libcloud_iaas_get_con(key, secret, iaas, iaashostname=None, iaasport=None):
if iaas.lower() == "nimbus":
conn = None
else:
Driver = get_driver(Provider.Provider.EC2_US_EAST)
conn = Driver(key, secret)
return IaaSLibCloudConn(conn, driver)

5 changes: 3 additions & 2 deletions cloudinitd/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,16 +432,17 @@ def _expand_attr_list(self, val):
def _expand_attr(self, val):
if not val:
return val
pattern = re.compile('\$\{(.*?)\.(.*)\}')
pattern = re.compile('\$\{(.*?)\.(.*?)\}')

match = pattern.search(val)
if match:
while match:
svc_name = match.group(1)
attr_name = match.group(2)
if svc_name:
val = self._top_level.find_dep(svc_name, attr_name)
else:
val = self.get_dep(attr_name)
match = pattern.search(val)
return val


Expand Down
1 change: 1 addition & 0 deletions tests/plans/terminate/top.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ allocation: env.CLOUDINITD_IAAS_ALLOCATION
sshkeyname: env.CLOUDINITD_IAAS_SSHKEYNAME
localsshkeypath: env.CLOUDINITD_IAAS_SSHKEY
ssh_username: env.CLOUDINITD_SSH_USERNAME
securitygroups: default

[runlevels]
level1: test-level1.conf
Expand Down

0 comments on commit e1cae67

Please sign in to comment.