(self, password=None, verify=True, browse=True)
return attached_disks
Attaches a disk image, returns list of Disk objects.
Attaches a disk image, returns list of Disk objects.
Attaches a disk image returns list of Disk objects .
def Attach(self, password=None, verify=True, browse=True):
    """Attaches a disk image, returns list of Disk objects."""

    if isinstance(self, EncryptedImage) and not password:
      raise MacDiskError("Encrypted Images cannot Attach without a password")

    command = ["hdiutil", "attach", "-plist"]

    if isinstance(self, EncryptedImage):
      command.append("-stdinpass")

    if not verify:
      command.append("-noverify")

    if not browse:
      command.append("-nobrowse")

    command.append(self.imagepath)

    plist = _DictFromSubprocess(command, stdin=password)
    attached_disks = []
    for entity in plist["system-entities"]:
      # strip off /dev from start
      deviceid = entity["dev-entry"].replace("/dev/", "")
      disk = Disk(deviceid)
      attached_disks.append(disk)
    self.attached = True
    self.attached_disks = attached_disks  # for later detaches.
    return attached_disks
def Attach ( self , password = None , verify = True , browse = True ) : if isinstance ( self , EncryptedImage ) and not password : raise MacDiskError ( "Encrypted Images cannot Attach without a password" ) command = [ "hdiutil" , "attach" , "-plist" ] if isinstance ( self , EncryptedImage ) : command . append ( "-stdinpass" ) if not verify : command . append ( "-noverify" ) if not browse : command . append ( "-nobrowse" ) command . append ( self . imagepath ) plist = _DictFromSubprocess ( command , stdin = password ) attached_disks = [ ] for entity in plist [ "system-entities" ] : # strip off /dev from start deviceid = entity [ "dev-entry" ] . replace ( "/dev/" , "" ) disk = Disk ( deviceid ) attached_disks . append ( disk ) self . attached = True self . attached_disks = attached_disks # for later detaches. return attached_disks