summaryrefslogtreecommitdiffstats
path: root/swift/1.4.8
diff options
context:
space:
mode:
authorPeter Portante <peter.portante@redhat.com>2012-10-18 15:39:32 -0400
committerAnand Avati <avati@redhat.com>2012-10-25 15:03:32 -0700
commit3ab5404fab2a26399cb6a3a58d8930378e4ccb23 (patch)
treede2568372a61f38f1be6e11e5e3f50677204b573 /swift/1.4.8
parent1a013e3e78c0afa7f6c6d8de3826280779bd0f2d (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>
Diffstat (limited to 'swift/1.4.8')
-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 72b2f389bc7..ef5f9d62f61 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