From 4b7bab9fc99e879a1e6342a21af1f14eb1eb1b8a Mon Sep 17 00:00:00 2001 From: Yuan Zhou Date: Wed, 26 Mar 2014 10:23:53 +0800 Subject: [PATCH] Update swift-get-nodes to use storage_directory util func Change-Id: I074d6c5f62e5218427c72b3e11de40da4ecfc0ab --- bin/swift-get-nodes | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/swift-get-nodes b/bin/swift-get-nodes index 36cfb7ecaa..d36cbeb623 100755 --- a/bin/swift-get-nodes +++ b/bin/swift-get-nodes @@ -19,7 +19,7 @@ import sys import urllib from swift.common.ring import Ring -from swift.common.utils import hash_path +from swift.common.utils import hash_path, storage_directory parser = optparse.OptionParser() @@ -127,16 +127,16 @@ print 'Use your own device location of servers:' print 'such as "export DEVICE=/srv/node"' for node in nodes: if hash_str: - print 'ssh %s "ls -lah ${DEVICE:-/srv/node}/%s/%s/%s/%s/%s/"' % ( - node['ip'], node['device'], loc, part, hash_str[-3:], hash_str) + print 'ssh %s "ls -lah ${DEVICE:-/srv/node}/%s/%s/"' % ( + node['ip'], node['device'], storage_directory(loc, part, hash_str)) else: print 'ssh %s "ls -lah ${DEVICE:-/srv/node}/%s/%s/%s/"' % ( node['ip'], node['device'], loc, part) for mnode in more_nodes: if hash_str: - print 'ssh %s "ls -lah ${DEVICE:-/srv/node}/%s/%s/%s/%s/%s/" '\ - '# [Handoff]' % (mnode['ip'], mnode['device'], loc, part, - hash_str[-3:], hash_str) + print 'ssh %s "ls -lah ${DEVICE:-/srv/node}/%s/%s/" '\ + '# [Handoff]' % (mnode['ip'], mnode['device'], + storage_directory(loc, part, hash_str)) else: print 'ssh %s "ls -lah ${DEVICE:-/srv/node}/%s/%s/%s/" # [Handoff]' % ( mnode['ip'], mnode['device'], loc, part)