ó
EŽUc           @   sU   d  d l  j Z d  d l Z d  d l m Z d  d l m Z d e f d     YZ d S(   i˙˙˙˙N(   t   Net(   t   Commandt   cmd_timec           B   sV   e  Z d  Z d Z i e j d 6e j d 6e j d 6Z d g Z	 d d d d d  Z RS(   sń  Retrieve the time on a server.

This command returns the date and time of the Active Directory server specified on the command.  The server name specified may be the local server or a remote server.  If the servername is not specified, the command returns the time and date of the local AD server.

Example1:
samba-tool time samdom.example.com

Example1 returns the date and time of the server samdom.example.com.

Example2:
samba-tool time

Example2 return the date and time of the local server.
s   %prog [server-name] [options]t	   sambaoptst   credoptst   versionoptss   server_name?c         C   sx   | j    } | j | d t } t | | d | j } | d  k rW t j |  } n  |  j j	 | j
 |  d  d  S(   Nt   fallback_machinet   servers   
(   t   get_loadparmt   get_credentialst   TrueR    t	   ipaddresst   Nonet   commont   netcmd_dnsnamet   outft   writet   time(   t   selft   server_nameR   R   R   t   lpt   credst   net(    (    s5   /usr/lib/python2.7/dist-packages/samba/netcmd/time.pyt   run4   s    N(   t   __name__t
   __module__t   __doc__t   synopsist   optionst   SambaOptionst   CredentialsOptionst   VersionOptionst   takes_optiongroupst
   takes_argsR   R   (    (    (    s5   /usr/lib/python2.7/dist-packages/samba/netcmd/time.pyR      s   

		(	   t   samba.getoptt   getoptR   R   t	   samba.netR    t   samba.netcmdR   R   (    (    (    s5   /usr/lib/python2.7/dist-packages/samba/netcmd/time.pyt   <module>   s   