@contextlib.contextmanager
def shade_exceptions(error_message=None):
    try:
        yield
    except exc.OpenStackCloudException:
        raise
    except Exception as e:
        if error_message is None:
            error_message = str(e)
        raise exc.OpenStackCloudException(error_message)
Context manager for dealing with shade exceptions.
dataset/ETHPy150Open openstack-infra/shade/shade/_utils.py/shade_exceptions