Merge branch 'Munki5dev' into new-msc-design

This commit is contained in:
Greg Neagle
2020-09-16 14:46:29 -07:00
17 changed files with 108 additions and 25 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/local/munki/python
#!/usr/local/munki/munki-python
# encoding: utf-8
#
# Copyright 2017-2020 Greg Neagle.
+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/local/munki/python
#!/usr/local/munki/munki-python
# encoding: utf-8
#
# Copyright 2018-2020 Greg Neagle.
+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/local/munki/python
#!/usr/local/munki/munki-python
# encoding: utf-8
#
# Copyright 2017-2020 Greg Neagle.
+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/local/munki/python
#!/usr/local/munki/munki-python
# encoding: utf-8
#
# Copyright 2010-2020 Greg Neagle.
+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/local/munki/python
#!/usr/local/munki/munki-python
# encoding: utf-8
#
# Copyright 2010-2020 Greg Neagle.
+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/local/munki/python
#!/usr/local/munki/munki-python
# encoding: utf-8
#
# Copyright 2011-2020 Greg Neagle.
+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/local/munki/python
#!/usr/local/munki/munki-python
# encoding: utf-8
#
# Copyright 2008-2020 Greg Neagle.
+23 -2
View File
@@ -1,4 +1,4 @@
#!/usr/local/munki/python
#!/usr/local/munki/munki-python
# encoding: utf-8
#
# Copyright 2009-2020 Greg Neagle.
@@ -218,6 +218,24 @@ def runScript(script, display_name, runtype):
display.display_warning(unicode_or_str(err))
return result
def cleanup(runtype):
"""
If there are executables inside the cleanup directory, run them and remove them if successful
"""
cleanupdir = os.path.join(os.path.realpath(os.path.dirname(sys.argv[0])), 'cleanup')
if not os.path.isdir(cleanupdir):
# path doesn't exist or isn't a directory
return
# get only filenames (and not directory names) from cleanupdir
(_, _, filenames) = next(os.walk(cleanupdir))
for filename in filenames:
script_path = os.path.join(cleanupdir, filename)
result = runScript(script_path, 'cleanup', runtype)
if not result:
# no output is a good thing
os.remove(script_path)
def doInstallTasks(do_apple_updates, only_unattended=False):
"""Perform our installation/removal tasks.
@@ -824,6 +842,9 @@ def main():
# Set environment variable for verbosity
os.environ['MUNKI_VERBOSITY_LEVEL'] = str(options.verbose)
# Run cleanup scripts if required
cleanup(runtype)
if options.installonly:
# we're only installing, not checking, so we should copy
# some report values from the prior run
@@ -1156,7 +1177,7 @@ def main():
time.sleep(2)
startLogoutHelper()
elif osutils.getconsoleuser() == u'loginwindow':
# someone is logged in, but we're sitting at the loginwindow
# someone is logged in, but we're sitting at the loginwindow
# due to to fast user switching so do nothing
munkilog.log('Skipping user notification because we are at the'
'loginwindow.')
+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/local/munki/python
#!/usr/local/munki/munki-python
# encoding: utf-8
#
# Copyright 2011-2020 Greg Neagle.
+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/local/munki/python
#!/usr/local/munki/munki-python
# encoding: utf-8
#
# Copyright 2010-2020 Greg Neagle.
+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/local/munki/python
#!/usr/local/munki/munki-python
# encoding: utf-8
#
# Copyright 2018-2020 Greg Neagle.
+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/local/munki/python
#!/usr/local/munki/munki-python
# encoding: utf-8
#
# Copyright 2011-2017 Google Inc. All Rights Reserved.
+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/local/munki/python
#!/usr/local/munki/munki-python
# encoding: utf-8
#
# Copyright 2009-2020 Greg Neagle.
+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/local/munki/python
#!/usr/local/munki/munki-python
# encoding: utf-8
#
# Copyright 2011-2013 Google Inc. All Rights Reserved.