def delete_stack(self, name, wait=True):
        deployment_name = self._encode_name(name)

        try:
            self.logger.info('Deleting Google Cloud deployment '
                             '[%s]' % deployment_name)
            operation = self.ds.deployments().delete(
                project=self.project, deployment=deployment_name
            ).execute()
        except GcloudApiError as e:
            raise ProviderException(e)

        status = DELETE_IN_PROGRESS

        # Wait until delete finishes.
        if wait:
            while True:
                try:
                    response = self.ds.operations().get(
                        project=self.project,
                        operation=operation["name"]
                    ).execute()

                    if response["status"] == "DONE":
                        if "error" in response:
                            errors = response["error"].get("errors")
                            if errors:
                                message = errors[0]["message"]
                            else:
                                message = "Error in operation."
                            raise ProviderException(message)

                        status = DELETE_COMPLETE
                        break
                except GcloudApiHttpError as e:
                    if e.resp.status == 404:
                        status = DELETE_COMPLETE
                        break
                    else:
                        raise ProviderException(e)
                except GcloudApiError as e:
                    raise ProviderException(e)

                self.sleep()

        return {"status": status}