Fix smaller python issues

Fixes:
- add missing spaces
- fix Redefining name 'uuid' from outer scope
- define exception types
- merge twice defined function is_mounted(dev)
- fix some (local) variable names