echo "Example: Auditing"
remember 'ls -l -h'
-remember 'emacs -nw +27 audit.py'
+remember 'emacs -nw audit.py'
remember './audit.py win7.img'
remember './audit.py rhel6.img'
import sys
import guestfs
-def mount_disk (g, root):
- mps = g.inspect_get_mountpoints (root)
- def compare (a, b):
- if len(a[0]) > len(b[0]):
- return 1
- elif len(a[0]) == len(b[0]):
- return 0
- else:
- return -1
- mps.sort (compare)
- for mp_dev in mps:
- try:
- g.mount_ro (mp_dev[1], mp_dev[0])
- except RuntimeError as msg:
- print "%s (ignored)" % msg
-
if len (sys.argv) != 2:
raise (Error ("disk [image]"))
disk = sys.argv[1]
raise (Error ("inspect_vm: no operating systems found"))
for root in roots:
- mount_disk (g, root)
+ mps = g.inspect_get_mountpoints (root)
+ def compare (a, b):
+ if len(a[0]) > len(b[0]):
+ return 1
+ elif len(a[0]) == len(b[0]):
+ return 0
+ else:
+ return -1
+ mps.sort (compare)
+ for mp_dev in mps:
+ try:
+ g.mount_ro (mp_dev[1], mp_dev[0])
+ except RuntimeError as msg:
+ print "%s (ignored)" % msg
apps = g.inspect_list_applications (root)
for app in apps: