'Main work function'

def work(self):

    self.check_cli_args()
    self.check_netconf_args(self.cur_netconf_cfg)
    self.get_proposed()
    self.get_existing()
    if (self.state == 'present'):
        if self.version:
            if (self.version != self.cur_cli_cfg['version']):
                self.merge_snmp_version()
        if self.connect_port:
            self.config_connect_port_cli()
        if self.cur_netconf_cfg['need_cfg']:
            self.merge_snmp_target_host()
    else:
        if self.connect_port:
            self.undo_config_connect_port_cli()
        if self.cur_netconf_cfg['need_cfg']:
            self.delete_snmp_target_host()
    self.check_netconf_args(self.end_netconf_cfg)
    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
    self.results['updates'] = self.updates_cmd
    self.module.exit_json(**self.results)
