1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

gpo: Fix startup scripts to not fail w/out params

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15212

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): David Mulder <dmulder@samba.org>
Autobuild-Date(master): Tue Oct 25 15:21:08 UTC 2022 on sn-devel-184
This commit is contained in:
David Mulder 2022-10-24 16:50:37 -06:00
parent 4206915255
commit 4f63c12807
2 changed files with 10 additions and 3 deletions

View File

@ -62,7 +62,11 @@ class vgp_startup_scripts_ext(gp_xml_ext):
script_file = os.path.join(local_path,
os.path.dirname(check_safe_path(path)).upper(),
script.upper())
parameters = listelement.find('parameters').text
parameters = listelement.find('parameters')
if parameters is not None:
parameters = parameters.text
else:
parameters = ''
hash = listelement.find('hash').text
attribute = '%s:%s:%s' % (script, hash, parameters)
old_val = self.gp_db.retrieve(str(self), attribute)
@ -105,7 +109,11 @@ class vgp_startup_scripts_ext(gp_xml_ext):
script_file = os.path.join(local_path,
os.path.dirname(check_safe_path(path)).upper(),
script.upper())
parameters = listelement.find('parameters').text
parameters = listelement.find('parameters')
if parameters is not None:
parameters = parameters.text
else:
parameters = ''
run_as = listelement.find('run_as')
if run_as is not None:
run_as = run_as.text

View File

@ -1 +0,0 @@
^samba.tests.gpo.samba.tests.gpo.GPOTests.test_vgp_startup_scripts*