From cb69dc881a44e200b2abef9d8e30ded0f2a0aa99 Mon Sep 17 00:00:00 2001 From: Kun Huang Date: Sat, 9 Mar 2013 03:13:18 +0800 Subject: [PATCH] Give friendly notification in swift-get-nodes Hard coding of '/srv/node' maybe drive to some errors. But it seems unfixable (please see talks in bug report). To avoid erros as we can, showing a friendly notification to let user set their own device location works better than hard coding directly. Change-Id: I45d749dd52af8d3b051dfe98dbb9d71a5a374f97 Fixes: bug #907908 --- bin/swift-get-nodes | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bin/swift-get-nodes b/bin/swift-get-nodes index cb46820c58..279f8d8262 100755 --- a/bin/swift-get-nodes +++ b/bin/swift-get-nodes @@ -123,17 +123,20 @@ for mnode in more_nodes: % (mnode['ip'], mnode['port'], mnode['device'], part, urllib.quote(target)) print "\n" +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 /srv/node/%s/%s/%s/%s/%s/"' % ( + print 'ssh %s "ls -lah ${DEVICE:-/srv/node}/%s/%s/%s/%s/%s/"' % ( node['ip'], node['device'], loc, part, hash_str[-3:], hash_str) else: - print 'ssh %s "ls -lah /srv/node/%s/%s/%s/"' % ( + 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 /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/%s/%s/%s/" '\ + '# [Handoff]' % (mnode['ip'], mnode['device'], loc, part, + hash_str[-3:], hash_str) else: - print 'ssh %s "ls -lah /srv/node/%s/%s/%s/" # [Handoff]' % ( + print 'ssh %s "ls -lah ${DEVICE:-/srv/node}/%s/%s/%s/" # [Handoff]' % ( mnode['ip'], mnode['device'], loc, part)