Merge "Fix format device"
This commit is contained in:
commit
c2f8f00a3e
@ -41,10 +41,10 @@ def format_device(dev):
|
||||
Format a device for display.
|
||||
"""
|
||||
if ':' in dev['ip']:
|
||||
return ('d%(id)sr%(region)z%(zone)s-'
|
||||
return ('d%(id)sr%(region)sz%(zone)s-'
|
||||
'[%(ip)s]:%(port)s/%(device)s_"%(meta)s"') % dev
|
||||
else:
|
||||
return ('d%(id)sr%(region)z%(zone)s-'
|
||||
return ('d%(id)sr%(region)sz%(zone)s-'
|
||||
'%(ip)s:%(port)s/%(device)s_"%(meta)s"') % dev
|
||||
|
||||
|
||||
@ -471,7 +471,7 @@ swift-ring-builder <builder_file> remove <search-value> [search-value ...]
|
||||
if len(devs) > 1:
|
||||
print 'Matched more than one device:'
|
||||
for dev in devs:
|
||||
print ' d%(id)sr%(region)z%(zone)s-%(ip)s:%(port)s/' \
|
||||
print ' d%(id)sr%(region)sz%(zone)s-%(ip)s:%(port)s/' \
|
||||
'%(device)s_"%(meta)s"' % dev
|
||||
if raw_input('Are you sure you want to remove these %s '
|
||||
'devices? (y/N) ' % len(devs)) != 'y':
|
||||
@ -494,7 +494,7 @@ swift-ring-builder <builder_file> remove <search-value> [search-value ...]
|
||||
print '-' * 79
|
||||
exit(EXIT_ERROR)
|
||||
|
||||
print 'd%(id)sr%(region)z%(zone)s-%(ip)s:%(port)s/' \
|
||||
print 'd%(id)sr%(region)sz%(zone)s-%(ip)s:%(port)s/' \
|
||||
'%(device)s_"%(meta)s" marked for removal and will ' \
|
||||
'be removed next rebalance.' % dev
|
||||
pickle.dump(builder.to_dict(), open(argv[1], 'wb'), protocol=2)
|
||||
|
Loading…
Reference in New Issue
Block a user