summaryrefslogtreecommitdiff
path: root/bin/swift-get-nodes
diff options
context:
space:
mode:
authorKun Huang <academicgareth@gmail.com>2013-03-09 03:13:18 +0800
committerKun Huang <academicgareth@gmail.com>2013-03-09 13:43:54 +0800
commitcb69dc881a44e200b2abef9d8e30ded0f2a0aa99 (patch)
tree98df67a544c0e31ac7222917b5b03350bf117429 /bin/swift-get-nodes
parent5e427e5e3b41ab2ddb377840f7ea196c1ba7327a (diff)
downloadswift-cb69dc881a44e200b2abef9d8e30ded0f2a0aa99.tar.gz
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
Diffstat (limited to 'bin/swift-get-nodes')
-rwxr-xr-xbin/swift-get-nodes13
1 files changed, 8 insertions, 5 deletions
diff --git a/bin/swift-get-nodes b/bin/swift-get-nodes
index cb46820c5..279f8d826 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)