def curl_head_command(ip, port, device, part, target, policy_index):
 if is_valid_ipv6(ip):
  formatted_ip = ('[%s]' % ip)
 else:
  formatted_ip = ip
 cmd = ('curl -g -I -XHEAD "http://%s:%s/%s/%s/%s"' % (formatted_ip, port, device, part, urllib.parse.quote(target)))
 if (policy_index is not None):
  cmd += (' -H "%s: %s"' % ('X-Backend-Storage-Policy-Index', policy_index))
 return cmd

def curl_head_command ( ip , port , device , part , target , policy_index ) : if is_valid_ipv6 ( ip ) : formatted_ip = ( '[%s]' % ip ) else : formatted_ip = ip cmd = ( 'curl -g -I -XHEAD "http://%s:%s/%s/%s/%s"' % ( formatted_ip , port , device , part , urllib . parse . quote ( target ) ) ) if ( policy_index is not None ) : cmd += ( ' -H "%s: %s"' % ( 'X-Backend-Storage-Policy-Index' , policy_index ) ) return cmd
provide a string that is a well formatted curl command to head an object on a storage node .