mirror of
https://github.com/samba-team/samba.git
synced 2025-12-17 04:23:50 +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
26
python/samba/netcmd/gpcommon.py
Normal file
26
python/samba/netcmd/gpcommon.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# Samba common group policy functions
|
||||
#
|
||||
# Copyright Andrew Tridgell 2010
|
||||
# Copyright Amitay Isaacs 2011-2012 <amitay@gmail.com>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
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)
|
||||
Reference in New Issue
Block a user