summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Portante <peter.portante@redhat.com>2012-10-18 15:39:32 -0400
committerPeter Portante <peter.portante@redhat.com>2013-04-29 16:35:55 -0400
commita226e39487f7f476970548d0abac752280c146cd (patch)
tree4d063fe1142c604c4a69842d414782a69f880769
parentc61aea1464475923690cb6180cb0c484748de775 (diff)
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 <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/4110 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Mohammed Junaid <junaid@redhat.com> Tested-by: Anand Avati <avati@redhat.com>
-rw-r--r--swift/1.4.8/plugins/utils.py23
1 files 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