def unmount_smb_share(self, smbfs_share, force=False):
    mappings = self._smb_conn.Msft_SmbMapping(RemotePath=smbfs_share)
    if (not mappings):
        LOG.debug('Share %s is not mounted. Skipping unmount.', smbfs_share)
    for mapping in mappings:
        try:
            mapping.Remove(Force=force)
        except AttributeError:
            pass
        except wmi.x_wmi:
            if force:
                raise vmutils.HyperVException(_('Could not unmount share: %s'), smbfs_share)
def unmount_smb_share(self, smbfs_share, force=False):
    mappings = self._smb_conn.Msft_SmbMapping(RemotePath=smbfs_share)
    if (not mappings):
        LOG.debug('Share %s is not mounted. Skipping unmount.', smbfs_share)
    for mapping in mappings:
        try:
            mapping.Remove(Force=force)
        except AttributeError:
            pass
        except wmi.x_wmi:
            if force:
                raise vmutils.HyperVException(_('Could not unmount share: %s'), smbfs_share)