Close and delete instance.
182235
def close(self):
        """"""

        # remove callbacks
        Datastore.stores[self.domain].remove(self)

        # delete data after the last instance is gone
        if self.release_storage and not Datastore.stores[self.domain]:
            del Datastore.global_data[self.domain]

        del self
695832
def delete(self):
        """"""
        check_bind(self)
        if self.id is None:
            raise ServerError("{} object does not exist yet".format(self.__class__.name))
        elif not self.__class__._has_schema_method("destroy"):
            raise MethodNotSupported("{} do not support deletion.".format(self.__class__.__name__))

        try:
            self._resource.delete()
        except HTTPError as e:
            if e.response.status_code == 403:
                raise PermissionDenied("")  # FIXME: is this right?
            else:
                raise e
241267
def DeleteInstance(self, si, logger, session, vcenter_data_model, vm_uuid, vm_name):
        
        # find vm
        vm = self.pv_service.find_by_uuid(si, vm_uuid)
        if vm is not None:
            # destroy vm
            result = self.pv_service.destroy_vm(vm=vm, logger=logger)
        else:
            resource___format = "Could not find the VM {0},will remove the resource.".format(vm_name)
            logger.info(resource___format)
            result = resource___format

        return result
1030506
def close(self):
        """"""
        if self.mapping is None:
            return

        self.mapping.close()
        self.mapping = None

        self._fd = None
940756
def destroySingleton(cls):
        
        singleton_key = '_{0}__singleton'.format(cls.__name__)
        singleton = getattr(cls, singleton_key, None)
        
        if singleton is not None:
            setattr(cls, singleton_key, None)

            singleton.close()
            singleton.deleteLater()
778760
def delete(self):
        """"""
        self._ensure_filename()
        self._close_if_open()
        os.remove(self.filename)
886509
def delete_instance(self, nova, instance):
        """"""

        # /!\ DEPRECATION WARNING
        self.log.warn('/!\\ DEPRECATION WARNING:  use '
                      'delete_resource instead of delete_instance.')
        self.log.debug('Deleting instance ({})...'.format(instance))
        return self.delete_resource(nova.servers, instance,
                                    msg='nova instance')
845856
def terminate(self):
        
        rs = self.connection.terminate_instances([self.id])
        if len(rs) > 0:
            self._update(rs[0])
715423
def close(self):
        """"""

        if hasattr(self, "conn"):
            self.conn.close()
            del self.conn
        if hasattr(self, "user"):
            del self.user
230331
def close(self):
        """"""
        # make sure the environment hasn't already been closed
        if self._env is None:
            raise ValueError('env has already been closed.')
        # purge the environment from C++ memory
        _LIB.Close(self._env)
        # deallocate the object locally
        self._env = None
        # if there is an image viewer open, delete it
        if self.viewer is not None:
            self.viewer.close()
163513
def _stop_instance(self):
        """"""
        instance = self._get_instance()
        self.compute_driver.ex_stop_node(instance)
        self._wait_on_instance('stopped', timeout=self.timeout)
599983
def _teardown(self):
        '''
        
        '''
        if not self._was_object_method:
            setattr(self._instance, self._attr, self._obj)
        else:
            delattr(self._instance, self._attr)
61240
def close(self):
        
        ep_list = self._ep_list
        while ep_list:
            ep_list.pop().close()
        self._closed = True
509909
def stop_instance(self, instance_id):
        
        instance = self._load_instance(instance_id)
        instance.terminate()
        del self._instances[instance_id]
145691
def delete(options = {})
      options = options.merge(instance_profile_name: @name)
      resp = @client.delete_instance_profile(options)
      resp.data
    end
336512
def _stop_instance(self):
        """"""
        instance = self._get_instance()
        instance.stop()
        self._wait_on_instance('stopped', self.timeout)
473636
def close(self) -> None:
        """"""
        if self.mmap is not None:
            self.mmap.close()

        try:
            os.close(self.fd)
        except OSError:
            pass