Skip to content

Commit

Permalink
Merge pull request #639 from grycap/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
micafer authored Jun 6, 2018
2 parents f857fa0 + 67981e7 commit 7c73852
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 70 deletions.
17 changes: 17 additions & 0 deletions IM/connectors/CloudConnector.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,23 @@ def delete_snapshots(self, vm, auth_data):
except:
self.log_exception("Error deleting snapshots.")

def get_cloud_init_data(self, radl):
"""
Get the cloud init data specified by the user in the RADL
"""
configure_name = None
if radl.contextualize.items:
system_name = radl.systems[0].name

for item in radl.contextualize.items.values():
if item.system == system_name and item.get_ctxt_tool() == "cloud_init":
configure_name = item.configure

if configure_name:
return radl.get_configure_by_name(configure_name).recipes
else:
return None

def log_msg(self, level, msg, exc_info=0):
msg = "Inf ID: %s: %s" % (self.inf.id, msg)
self.logger.log(level, msg, exc_info=exc_info)
Expand Down
17 changes: 0 additions & 17 deletions IM/connectors/EC2.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,23 +497,6 @@ def get_default_subnet(self, conn):

return vpc_id, subnet_id

def get_cloud_init_data(self, radl):
"""
Get the cloud init data specified by the user in the RADL
"""
configure_name = None
if radl.contextualize.items:
system_name = radl.systems[0].name

for item in radl.contextualize.items.values():
if item.system == system_name and item.get_ctxt_tool() == "cloud_init":
configure_name = item.configure

if configure_name:
return radl.get_configure_by_name(configure_name).recipes
else:
return None

def launch(self, inf, radl, requested_radl, num_vm, auth_data):

im_username = "im_user"
Expand Down
17 changes: 0 additions & 17 deletions IM/connectors/GCE.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,23 +353,6 @@ def get_default_net(self, driver):
else:
return None

def get_cloud_init_data(self, radl):
"""
Get the cloud init data specified by the user in the RADL
"""
configure_name = None
if radl.contextualize.items:
system_name = radl.systems[0].name

for item in radl.contextualize.items.values():
if item.system == system_name and item.get_ctxt_tool() == "cloud_init":
configure_name = item.configure

if configure_name:
return radl.get_configure_by_name(configure_name).recipes
else:
return None

def create_firewall(self, inf, net_name, radl, driver):
"""
Create a firewall for the net using the outports param
Expand Down
17 changes: 0 additions & 17 deletions IM/connectors/OCCI.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,23 +552,6 @@ def get_os_tpl_scheme(self, occi_info, os_tpl):
"""
return self.get_scheme(occi_info, os_tpl, 'os_tpl')

def get_cloud_init_data(self, radl):
"""
Get the cloud init data specified by the user in the RADL
"""
configure_name = None
if radl.contextualize.items:
system_name = radl.systems[0].name

for item in radl.contextualize.items.values():
if item.system == system_name and item.get_ctxt_tool() == "cloud_init":
configure_name = item.configure

if configure_name:
return radl.get_configure_by_name(configure_name).recipes
else:
return None

def create_volumes(self, system, auth_data):
"""
Attach the required volumes (in the RADL) to the launched instance
Expand Down
17 changes: 0 additions & 17 deletions IM/connectors/OpenStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,23 +566,6 @@ def get_networks(self, driver, radl):

return nets

def get_cloud_init_data(self, radl):
"""
Get the cloud init data specified by the user in the RADL
"""
configure_name = None
if radl.contextualize.items:
system_name = radl.systems[0].name

for item in radl.contextualize.items.values():
if item.system == system_name and item.get_ctxt_tool() == "cloud_init":
configure_name = item.configure

if configure_name:
return radl.get_configure_by_name(configure_name).recipes
else:
return None

def launch(self, inf, radl, requested_radl, num_vm, auth_data):
driver = self.get_driver(auth_data)

Expand Down
4 changes: 2 additions & 2 deletions contextualization/conf-ansible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
ignore_errors: yes
register: python_install
changed_when: python_install.stdout_lines|length > 1
when: python_exists|failed
when: python_exists is failed

- name: Get Facts
setup:
Expand Down Expand Up @@ -44,7 +44,7 @@

- name: Ubuntu force apt update (avoid apt lock)
command: apt update
when: ansible_distribution == "Ubuntu" and apt_update|failed
when: ansible_distribution == "Ubuntu" and apt_update is failed

- name: Ubuntu install requirements
apt: name=software-properties-common
Expand Down

0 comments on commit 7c73852

Please sign in to comment.