diff --git a/IM/connectors/CloudConnector.py b/IM/connectors/CloudConnector.py index 883e4242b..f03d7f092 100644 --- a/IM/connectors/CloudConnector.py +++ b/IM/connectors/CloudConnector.py @@ -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) diff --git a/IM/connectors/EC2.py b/IM/connectors/EC2.py index a62a60899..30b2ade73 100644 --- a/IM/connectors/EC2.py +++ b/IM/connectors/EC2.py @@ -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" diff --git a/IM/connectors/GCE.py b/IM/connectors/GCE.py index eeb38664f..ead0fcea9 100644 --- a/IM/connectors/GCE.py +++ b/IM/connectors/GCE.py @@ -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 diff --git a/IM/connectors/OCCI.py b/IM/connectors/OCCI.py index dcb56f9a5..f004d0f85 100644 --- a/IM/connectors/OCCI.py +++ b/IM/connectors/OCCI.py @@ -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 diff --git a/IM/connectors/OpenStack.py b/IM/connectors/OpenStack.py index c27bdf8f0..ea9bad86c 100644 --- a/IM/connectors/OpenStack.py +++ b/IM/connectors/OpenStack.py @@ -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) diff --git a/contextualization/conf-ansible.yml b/contextualization/conf-ansible.yml index 88babdb30..694dca8a2 100644 --- a/contextualization/conf-ansible.yml +++ b/contextualization/conf-ansible.yml @@ -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: @@ -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