def delete_domain(self, domain_id=None, name_or_id=None):
        if domain_id is None:
            if name_or_id is None:
                raise OpenStackCloudException(
                    "You must pass either domain_id or name_or_id value"
                )
            dom = self.get_domain(None, name_or_id)
            if dom is None:
                self.log.debug(
                    "Domain {0} not found for deleting".format(name_or_id))
                return False
            domain_id = dom['id']

        with _utils.shade_exceptions(
            "Failed to delete domain {id}".format(id=domain_id)):
            # Deleting a domain is expensive, so disabling it first increases
            # the changes of success
            domain = self.update_domain(domain_id, enabled=False)
            self.manager.submitTask(_tasks.DomainDelete(domain=domain['id']))

        return True
Delete a Keystone domain.
dataset/ETHPy150Open openstack-infra/shade/shade/operatorcloud.py/OperatorCloud.delete_domain