From a226e39487f7f476970548d0abac752280c146cd Mon Sep 17 00:00:00 2001 From: Peter Portante Date: Thu, 18 Oct 2012 15:39:32 -0400 Subject: Move _add_timestamp() closer to where it is used Simple refactoring to move _add_timestamp() closer to where it is used ahead of further refactoring changes. Change-Id: I175c5672202f2d961c72d4e2f4a441b47de1ba28 Signed-off-by: Peter Portante Reviewed-on: http://review.gluster.org/4110 Reviewed-by: Kaleb KEITHLEY Reviewed-by: Mohammed Junaid Tested-by: Anand Avati --- swift/1.4.8/plugins/utils.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/swift/1.4.8/plugins/utils.py b/swift/1.4.8/plugins/utils.py index 72b2f38..ef5f9d6 100644 --- a/swift/1.4.8/plugins/utils.py +++ b/swift/1.4.8/plugins/utils.py @@ -176,17 +176,6 @@ def do_rename(old_path, new_path): raise return True -def _add_timestamp(metadata_i): - # At this point we have a simple key/value dictionary, turn it into - # key/(value,timestamp) pairs. - timestamp = 0 - metadata = {} - for key, value_i in metadata_i.iteritems(): - if not isinstance(value_i, tuple): - metadata[key] = (value_i, timestamp) - else: - metadata[key] = value_i - return metadata def read_metadata(path): """ @@ -587,6 +576,18 @@ def get_object_metadata(obj_path): return metadata +def _add_timestamp(metadata_i): + # At this point we have a simple key/value dictionary, turn it into + # key/(value,timestamp) pairs. + timestamp = 0 + metadata = {} + for key, value_i in metadata_i.iteritems(): + if not isinstance(value_i, tuple): + metadata[key] = (value_i, timestamp) + else: + metadata[key] = value_i + return metadata + def get_container_metadata(cont_path, memcache=None): objects = [] object_count = 0 -- cgit