'worker'

def work(self):

    self.check_params()
    self.vni2bd_info = self.get_vni2bd_dict()
    if self.nve_name:
        self.nve_info = self.get_nve_dict(self.nve_name)
    self.get_existing()
    self.get_proposed()
    if (self.state == 'present'):
        if (self.bridge_domain_id and self.vni_id):
            self.config_merge_vni2bd(self.bridge_domain_id, self.vni_id)
        if self.nve_name:
            if self.check_nve_interface(self.nve_name):
                if self.nve_mode:
                    self.config_merge_mode(self.nve_name, self.nve_mode)
                if self.source_ip:
                    self.config_merge_source_ip(self.nve_name, self.source_ip)
                if (self.vni_id and self.peer_list_ip):
                    self.config_merge_vni_peer_ip(self.nve_name, self.vni_id, self.peer_list_ip)
                if (self.vni_id and self.protocol_type):
                    self.config_merge_vni_protocol_type(self.nve_name, self.vni_id, self.protocol_type)
            else:
                self.module.fail_json(msg=('Error:    Nve    interface    %s    does    not    exist.' % self.nve_name))
    else:
        if (self.bridge_domain_id and self.vni_id):
            self.config_delete_vni2bd(self.bridge_domain_id, self.vni_id)
        if self.nve_name:
            if self.check_nve_interface(self.nve_name):
                if self.nve_mode:
                    self.config_delete_mode(self.nve_name, self.nve_mode)
                if self.source_ip:
                    self.config_delete_source_ip(self.nve_name, self.source_ip)
                if (self.vni_id and self.peer_list_ip):
                    self.config_delete_vni_peer_ip(self.nve_name, self.vni_id, self.peer_list_ip)
                if (self.vni_id and self.protocol_type):
                    self.config_delete_vni_protocol_type(self.nve_name, self.vni_id, self.protocol_type)
            else:
                self.module.fail_json(msg=('Error:    Nve    interface    %s    does    not    exist.' % self.nve_name))
    self.get_end_state()
    self.results['changed'] = self.changed
    self.results['proposed'] = self.proposed
    self.results['existing'] = self.existing
    self.results['end_state'] = self.end_state
    if self.changed:
        self.results['updates'] = self.updates_cmd
    else:
        self.results['updates'] = list()
    self.module.exit_json(**self.results)
