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>
This commit is contained in:
parent
1a013e3e78
commit
3ab5404fab
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user