The nova.virt.disk.vfs.localfs Module

class VFSLocalFS(imgfile, imgfmt='raw', partition=None, imgdir=None)

Bases: nova.virt.disk.vfs.api.VFS

os.path.join() with safety check for injected file paths.

Join the supplied path components and make sure that the resulting path we are injecting into is within the mounted guest fs. Trying to be clever and specifying a path with ‘..’ in it will hit this safeguard.

append_file(path, content)
has_file(path)
make_path(path)
read_file(path)
replace_file(path, content)
set_ownership(path, user, group)
set_permissions(path, mode)
setup()
teardown()

Previous topic

The nova.virt.disk.vfs.guestfs Module

Next topic

The nova.virt.driver Module

This Page