mirror of
https://github.com/munki/munki.git
synced 2026-05-03 10:59:48 -05:00
Merge pull request #520 from natewalck/master
Added LocalOnlyManifest feature
This commit is contained in:
@@ -2640,7 +2640,7 @@ def cleanUpManifests():
|
||||
|
||||
if name in exceptions:
|
||||
continue
|
||||
|
||||
|
||||
abs_path = os.path.join(dirpath, name)
|
||||
rel_path = abs_path[len(manifest_dir):].lstrip("/")
|
||||
|
||||
@@ -3038,6 +3038,46 @@ def check(client_id='', localmanifestpath=None):
|
||||
if installinfo.get('optional_installs'):
|
||||
updateAvailableLicenseSeats(installinfo)
|
||||
|
||||
# process LocalOnlyManifest installs
|
||||
localonlymanifestname = munkicommon.pref('LocalOnlyManifest')
|
||||
if localonlymanifestname:
|
||||
localonlymanifest = os.path.join(
|
||||
ManagedInstallDir, 'manifests', localonlymanifestname)
|
||||
|
||||
# if the manifest already exists, the name is being reused
|
||||
if localonlymanifestname in MANIFESTS:
|
||||
munkicommon.display_error(
|
||||
"LocalOnlyManifest %s has the same name as an existing " \
|
||||
"manifest, skipping...", localonlymanifestname
|
||||
)
|
||||
else:
|
||||
MANIFESTS[localonlymanifestname] = localonlymanifest
|
||||
if os.path.exists(localonlymanifest):
|
||||
# use catalogs from main manifest for local only manifest
|
||||
cataloglist = getManifestValueForKey(
|
||||
mainmanifestpath, 'catalogs')
|
||||
munkicommon.display_detail(
|
||||
'**Processing local-only choices**'
|
||||
)
|
||||
|
||||
localonlyinstalls = getManifestValueForKey(
|
||||
localonlymanifest, 'managed_installs') or []
|
||||
for item in localonlyinstalls:
|
||||
dummy_result = processInstall(
|
||||
item,
|
||||
cataloglist,
|
||||
installinfo
|
||||
)
|
||||
|
||||
localonlyuninstalls = getManifestValueForKey(
|
||||
localonlymanifest, 'managed_uninstalls') or []
|
||||
for item in localonlyuninstalls:
|
||||
dummy_result = processRemoval(
|
||||
item,
|
||||
cataloglist,
|
||||
installinfo
|
||||
)
|
||||
|
||||
# now process any self-serve choices
|
||||
usermanifest = '/Users/Shared/.SelfServeManifest'
|
||||
selfservemanifest = os.path.join(
|
||||
|
||||
Reference in New Issue
Block a user