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
This commit is contained in:
Kun Huang 2013-03-09 03:13:18 +08:00
parent 5e427e5e3b
commit cb69dc881a

View File

@ -123,17 +123,20 @@ for mnode in more_nodes:
% (mnode['ip'], mnode['port'], mnode['device'], part, % (mnode['ip'], mnode['port'], mnode['device'], part,
urllib.quote(target)) urllib.quote(target))
print "\n" print "\n"
print 'Use your own device location of servers:'
print 'such as "export DEVICE=/srv/node"'
for node in nodes: for node in nodes:
if hash_str: 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) node['ip'], node['device'], loc, part, hash_str[-3:], hash_str)
else: 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) node['ip'], node['device'], loc, part)
for mnode in more_nodes: for mnode in more_nodes:
if hash_str: if hash_str:
print 'ssh %s "ls -lah /srv/node/%s/%s/%s/%s/%s/" # [Handoff]' % ( print 'ssh %s "ls -lah ${DEVICE:-/srv/node}/%s/%s/%s/%s/%s/" '\
mnode['ip'], mnode['device'], loc, part, hash_str[-3:], hash_str) '# [Handoff]' % (mnode['ip'], mnode['device'], loc, part,
hash_str[-3:], hash_str)
else: 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) mnode['ip'], mnode['device'], loc, part)