def cleanup(self):
        """Releases all resources."""
        filesystem = None

        if self._domain is not None:
            if self.configuration in 'filesystem':
                filesystem = os.path.join(self.configuration['filesystem']['source_path'], self.identifier)
            domain_delete(self._domain, self.logger, filesystem)
        if self._network is not None:
            try:
                network.delete(self._network)
            except Exception:
                self.logger.exception("Unable to delete network.")
        if self._hypervisor is not None:
            try:
                self._hypervisor.close()
            except Exception:
                self.logger.exception("Unable to close hypervisor connection.")
dataset/ETHPy150Open F-Secure/see/see/context/resources/lxc.py/LXCResources.cleanup/swapped operands of `in`