mirror of
https://github.com/samba-team/samba.git
synced 2025-12-23 00:23:53 +03:00
samba-tool: Move create_directory_hier to a common file
This is in preparation for needing it here later. Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
committed by
Andrew Bartlett
parent
e40faf7a75
commit
d6194600c1
@@ -77,6 +77,7 @@ from samba.ntstatus import (
|
||||
NT_STATUS_OBJECT_PATH_NOT_FOUND,
|
||||
NT_STATUS_ACCESS_DENIED
|
||||
)
|
||||
from samba.netcmd.gpcommon import create_directory_hier
|
||||
|
||||
|
||||
def gpo_flags_string(value):
|
||||
@@ -382,14 +383,6 @@ def copy_directory_local_to_remote(conn, localdir, remotedir,
|
||||
conn.savefile(r_name, data)
|
||||
|
||||
|
||||
def create_directory_hier(conn, remotedir):
|
||||
elems = remotedir.replace('/', '\\').split('\\')
|
||||
path = ""
|
||||
for e in elems:
|
||||
path = path + '\\' + e
|
||||
if not conn.chkpath(path):
|
||||
conn.mkdir(path)
|
||||
|
||||
def smb_connection(dc_hostname, service, lp, creds):
|
||||
# SMB connect to DC
|
||||
# Force signing for the smb connection
|
||||
|
||||
Reference in New Issue
Block a user