From 80836e676ab0edb6d41e76abb837c2e82606b444 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Tue, 17 Mar 2015 13:43:09 -0400 Subject: [PATCH] rename the helper to to_obj Signed-off-by: Alfredo Deza --- radosgw_agent/tests/util/test_obj.py | 2 +- radosgw_agent/util/obj.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/radosgw_agent/tests/util/test_obj.py b/radosgw_agent/tests/util/test_obj.py index f25c8aa..e3e3575 100644 --- a/radosgw_agent/tests/util/test_obj.py +++ b/radosgw_agent/tests/util/test_obj.py @@ -36,5 +36,5 @@ class TestKeysToAttribute(object): def test_replace_dashes(self): dictionary = {'dashed-word': 1} - result = obj.keys_to_attributes(dictionary) + result = obj.to_obj(dictionary) assert result.dashed_word == 1 diff --git a/radosgw_agent/util/obj.py b/radosgw_agent/util/obj.py index 09ffbda..e170fb6 100644 --- a/radosgw_agent/util/obj.py +++ b/radosgw_agent/util/obj.py @@ -22,7 +22,7 @@ def to_dict(_object, **extra_keys): return dictified_obj -def keys_to_attributes(dictionary, name="BucketEntry"): +def to_obj(dictionary, name="BucketEntry"): """ Because some objects are dynamic, we are forced to skip namedtuples and set the attributes from keys in dictionaries so that accessing them -- 2.47.3