
    S                     `    S r SSKJr  SSKJr  SSKJr  SSKJr  SSKrSSKrSr	Sr
SrS	 rS
 rg)z0Common utility functions for network operations.    )absolute_import)division)unicode_literals)timesN      c                      [         R                  " [        R                  " U 5      5      R                  nU[
        [        4;  a  [        S5      eU$ ! [         a	    [        s $ f = f)zGiven an ip address, determine IP version.

Args:
  ip_address: string, IP address to test IP version of

Returns:
  int, the IP version if it could be determined or IP_VERSION_UNKNOWN
  otherwise.
z#Reported IP version not recognized.)		ipaddress
ip_addresssix	text_typeversionIP_VERSION_4IP_VERSION_6
ValueErrorIP_VERSION_UNKNOWN)r   r   s     )lib/googlecloudsdk/api_lib/sql/network.pyGetIpVersionr      sY    ""3==#<=EEG|\22<==N	 s   AA A&%A&c                  F    [         R                  " [         R                  S9$ )z!Returns the current UTC datetime.)tzinfo)r   NowUTC     r   GetCurrentTimer   2   s    	%))	$$r   )__doc__
__future__r   r   r   googlecloudsdk.core.utilr   r
   r   r   r   r   r   r   r   r   r   <module>r      s6    7 &  ' *  
 (%r   