def execute(self, nets, vlan_ids): self.remove_previous_task() task = Task( name="check_networks", cluster=self.cluster ) if not task.cluster.nodes: task.status = 'error' task.message = ('There should be at least 1 node for dhcp check.' 'And 2 nodes for connectivity check') db().add(task) db().commit() self._call_silently( task, tasks.CheckNetworksTask, data=nets, check_admin_untagged=True ) db().refresh(task) #disable neutron with vlan connectivity check after deployment if task.status != 'error': if ( task.cluster.status != 'new' and task.cluster.net_provider == 'neutron' ): task.status = 'error' task.message = ('Network verification on Neutron' ' is not implemented yet') db().commit() if task.status != 'error': # this one is connected with UI issues - we need to # separate if error happened inside nailgun or somewhere # in the orchestrator, and UI does it by task name. dhcp_subtask = Task( name='check_dhcp', cluster=self.cluster, parent_id=task.id) db().add(dhcp_subtask) db().commit() db().refresh(task) task.name = 'verify_networks' self._call_silently( task, tasks.VerifyNetworksTask, vlan_ids ) return task
def execute(self, nets, vlan_ids): task = Task(name="check_networks", cluster=self.cluster) if not task.cluster.nodes: task.status = 'error' task.message = ('There should be at least 1 node for dhcp check.' 'And 2 nodes for connectivity check') db().add(task) db().commit() self._call_silently(task, tasks.CheckNetworksTask, nets) db().refresh(task) if task.status != 'error': # this one is connected with UI issues - we need to # separate if error happened inside nailgun or somewhere # in the orchestrator, and UI does it by task name. dhcp_subtask = Task(name='check_dhcp', cluster=self.cluster, parent_id=task.id) db().add(dhcp_subtask) db().commit() db().refresh(task) task.name = 'verify_networks' self._call_silently(task, tasks.VerifyNetworksTask, vlan_ids) return task
def execute(self, nets, vlan_ids): self.remove_previous_task() task = Task( name="check_networks", cluster=self.cluster ) if not task.cluster.nodes: task.status = 'error' task.message = ('There should be at least 1 node for dhcp check.' 'And 2 nodes for connectivity check') db().add(task) db().commit() self._call_silently( task, tasks.CheckNetworksTask, nets ) db().refresh(task) if task.status != 'error': # this one is connected with UI issues - we need to # separate if error happened inside nailgun or somewhere # in the orchestrator, and UI does it by task name. dhcp_subtask = Task( name='check_dhcp', cluster=self.cluster, parent_id=task.id) db().add(dhcp_subtask) db().commit() db().refresh(task) task.name = 'verify_networks' self._call_silently( task, tasks.VerifyNetworksTask, vlan_ids ) return task