def list2ormp(result_obj):
    """Bizarrely, OpsRamp sometimes returns a simple list for
    Resources API calls instead of its usual results struct."""
    if isinstance(result_obj, dict):
        assert 'results' in result_obj
        assert 'totalResults' in result_obj
        return result_obj
    assert isinstance(result_obj, list)
    count = len(result_obj)
    retval = {'totalResults': count, 'pageSize': count, 'totalPages': 1,
        'pageNo': 1, 'previousPageNo': 0, 'nextPage': False,
        'descendingOrder': False, 'results': result_obj}
    return retval
