Mount filesystem from either a real device or disk image
(device_or_image, mountpoint)
| 158 | |
| 159 | |
| 160 | def mount_filesystem(device_or_image, mountpoint): |
| 161 | """Mount filesystem from either a real device or disk image""" |
| 162 | if _is_block_device(device_or_image): |
| 163 | option = 'rw,nosuid,nodev,noexec' |
| 164 | else: |
| 165 | option = 'loop' |
| 166 | args = ['mount', '-o', option, device_or_image, mountpoint] |
| 167 | run_or_die(args) |
| 168 | logger.debug('mounted %s at %s', device_or_image, mountpoint) |
| 169 | |
| 170 | |
| 171 | def unmount_filesystem(mountpoint): |
no test coverage detected