diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-15 07:45:40 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:23:08 -0500 |
commit | 7913cbbe11075c75770d37cf2e0da8f7af51a7fc (patch) | |
tree | 4ee9f5466c1079dfcc2b286ddf604547ad4467a6 /source4/scripting/libjs | |
parent | a0bc4da1a307753e3b28a11863f50d66b0894190 (diff) | |
download | samba-7913cbbe11075c75770d37cf2e0da8f7af51a7fc.tar.gz samba-7913cbbe11075c75770d37cf2e0da8f7af51a7fc.tar.bz2 samba-7913cbbe11075c75770d37cf2e0da8f7af51a7fc.zip |
r8484: switched the sys_*() calls to the OO interface
tim, do you want to do the cli_*() calls now?
(This used to be commit 9991e924e9dacec663a5d040ccfc878927fc3afa)
Diffstat (limited to 'source4/scripting/libjs')
-rw-r--r-- | source4/scripting/libjs/provision.js | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/source4/scripting/libjs/provision.js b/source4/scripting/libjs/provision.js index 6d4e4a3bc0..06b6f03779 100644 --- a/source4/scripting/libjs/provision.js +++ b/source4/scripting/libjs/provision.js @@ -7,6 +7,8 @@ /* used to generate sequence numbers for records */ provision_next_usn = 1; +sys = sys_init(); + /* find a user or group from a list of possibilities */ @@ -59,7 +61,7 @@ unixName: ${UNIXNAME} */ function nttime() { - return "" + sys_nttime(); + return "" + sys.nttime(); } /* @@ -67,7 +69,7 @@ function nttime() */ function ldaptime() { - return sys_ldaptime(sys_nttime()); + return sys.ldaptime(sys.nttime()); } /* @@ -75,7 +77,7 @@ function ldaptime() */ function datestring() { - var t = sys_gmtime(sys_nttime()); + var t = sys.gmtime(sys.nttime()); return sprintf("%04u%02u%02u%02u", t.tm_year+1900, t.tm_mon+1, t.tm_mday, t.tm_hour); } @@ -85,7 +87,7 @@ function datestring() */ function hostip() { - var list = sys_interfaces(); + var list = sys.interfaces(); return list[0]; } @@ -103,7 +105,7 @@ function nextusn() */ function hostname() { - var s = split(".", sys_hostname()); + var s = split(".", sys.hostname()); return s[0]; } @@ -123,9 +125,9 @@ function setup_ldb(ldif, dbname, subobj) var db = lpGet("private dir") + "/" + dbname; var src = lpGet("setup directory") + "/" + ldif; - sys_unlink(db); + sys.unlink(db); - var data = sys_file_load(src); + var data = sys.file_load(src); data = data + extra; data = substitute_var(data, subobj); @@ -141,12 +143,12 @@ function setup_file(template, fname, subobj) var f = lpGet("private dir") + "/" + fname; var src = lpGet("setup directory") + "/" + template; - sys_unlink(f); + sys.unlink(f); - var data = sys_file_load(src); + var data = sys.file_load(src); data = substitute_var(data, subobj); - ok = sys_file_save(f, data); + ok = sys.file_save(f, data); assert(ok); } |