<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def teardown_logical_port_connectivity(self, context, port_db, hosting_device_id):
 """Removes connectivity for a logical port. Unplugs the corresponding data interface from the VM. """

        if port_db is None or port_db.get('id') is None:
            LOG.warning("Port id is None! Cannot remove port "
                        "from hosting_device:%s", hosting_device_id)
            return
        hosting_port_id = port_db.hosting_info.hosting_port.id
        try:
            self._dev_mgr.svc_vm_mgr.interface_detach(hosting_device_id,
                                                      hosting_port_id)
            self._gt_pool.spawn_n(self._cleanup_hosting_port, context,
                                  hosting_port_id)
            LOG.debug("Teardown logicalport completed for port:%s", port_db.id)

        except Exception as e:
            LOG.error("Failed to detach interface corresponding to port:"
                      "%(p_id)s on hosting device:%(hd_id)s due to "
                      "error %(error)s", {'p_id': hosting_port_id,
                                          'hd_id': hosting_device_id,
                                          'error': str(e)})