python/samba: add current_unix_time()
authorStefan Metzmacher <metze@samba.org>
Thu, 22 Jan 2015 11:23:09 +0000 (11:23 +0000)
committerStefan Metzmacher <metze@samba.org>
Wed, 8 Jul 2015 16:38:22 +0000 (18:38 +0200)
This is needed to get the time from modules in python/samba/netcmd/
where a time.py exist.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/__init__.py

index 1d1f27db55a06f9d96b11f95c80485e1509b825e..84b0b1fb2d53df71631407cbe4157ffbb7a10144 100644 (file)
@@ -24,6 +24,7 @@ __docformat__ = "restructuredText"
 
 import os
 import sys
+import time
 import samba.param
 
 
@@ -358,6 +359,9 @@ def dn_from_dns_name(dnsdomain):
     """return a DN from a DNS name domain/forest root"""
     return "DC=" + ",DC=".join(dnsdomain.split("."))
 
+def current_unix_time():
+    return int(time.time())
+
 import _glue
 version = _glue.version
 interface_ips = _glue.interface_ips