From 67981e7d062ce85ed1c139002ae7df05f6f279a4 Mon Sep 17 00:00:00 2001 From: micafer Date: Wed, 6 Jun 2018 15:15:48 +0200 Subject: [PATCH] Move get_cloud_init_data to parent class --- IM/connectors/EC2.py | 17 ----------------- IM/connectors/GCE.py | 17 ----------------- IM/connectors/OCCI.py | 17 ----------------- 3 files changed, 51 deletions(-) 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