a
    I_                     @   sD   d dl mZ ddlmZ d dlmZ d dlmZ G dd deZ	dS )    N   )common)Net)Commandc                   @   s6   e Zd ZdZdZejejejdZ	dgZ
dddZdS )	cmd_timea  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.
z%prog [server-name] [options])	sambaoptscredoptsversionoptszserver_name?Nc                 C   sR   |  }|j|dd}t|||jd}|d u r8t|}| j||d  d S )NT)Zfallback_machine)Zserver
)	Zget_loadparmZget_credentialsr   Z	ipaddressr   Znetcmd_dnsnameZoutfwritetime)selfZserver_namer   r   r	   ZlpZcredsZnet r   6/usr/lib/python3/dist-packages/samba/netcmd/nettime.pyrun5   s    
zcmd_time.run)NNNN)__name__
__module____qualname____doc__ZsynopsisoptionsZSambaOptionsZCredentialsOptionsZVersionOptionsZtakes_optiongroupsZ
takes_argsr   r   r   r   r   r      s     r   )
Zsamba.getoptZgetoptr    r   Z	samba.netr   Zsamba.netcmdr   r   r   r   r   r   <module>   s   