def format_device(dev):
 copy_dev = dev.copy()
 for key in ('ip', 'replication_ip'):
  if (':' in copy_dev[key]):
   copy_dev[key] = (('[' + copy_dev[key]) + ']')
 return ('d%(id)sr%(region)sz%(zone)s-%(ip)s:%(port)sR%(replication_ip)s:%(replication_port)s/%(device)s_"%(meta)s"' % copy_dev)

def format_device ( dev ) : copy_dev = dev . copy ( ) for key in ( 'ip' , 'replication_ip' ) : if ( ':' in copy_dev [ key ] ) : copy_dev [ key ] = ( ( '[' + copy_dev [ key ] ) + ']' ) return ( 'd%(id)sr%(region)sz%(zone)s-%(ip)s:%(port)sR%(replication_ip)s:%(replication_port)s/%(device)s_"%(meta)s"' % copy_dev )
format a device for display .