mirror of
https://github.com/munki/munki.git
synced 2026-04-28 00:13:45 -05:00
Added use_existing_mounts argument for mountdmg()
This should ensure that existing callers of this method do not get modified behavior.
This commit is contained in:
@@ -890,7 +890,7 @@ def mountPointsForDmg(dmgpath):
|
||||
return mountpoints
|
||||
|
||||
|
||||
def mountdmg(dmgpath, use_shadow=False):
|
||||
def mountdmg(dmgpath, use_shadow=False, use_existing_mounts=False):
|
||||
"""
|
||||
Attempts to mount the dmg at dmgpath
|
||||
and returns a list of mountpoints
|
||||
@@ -899,11 +899,12 @@ def mountdmg(dmgpath, use_shadow=False):
|
||||
mountpoints = []
|
||||
dmgname = os.path.basename(dmgpath)
|
||||
|
||||
# Check if this dmg is already mounted
|
||||
# and if so, bail out and return the mountpoints
|
||||
if dmgIsMounted(dmgpath):
|
||||
mountpoints = mountPointsForDmg(dmgpath)
|
||||
return mountpoints
|
||||
if (use_existing_mounts):
|
||||
# Check if this dmg is already mounted
|
||||
# and if so, bail out and return the mountpoints
|
||||
if diskImageIsMounted(dmgpath):
|
||||
mountpoints = mountPointsForDiskImage(dmgpath)
|
||||
return mountpoints
|
||||
|
||||
# Attempt to mount the dmg
|
||||
stdin = ''
|
||||
|
||||
Reference in New Issue
Block a user