class documentation
class FileDeviceHelper(object):
Undocumented
| Class Method | |
Create a new file and its file device helper. |
| Method | __init__ |
Create a new file device helper. |
| Method | |
Check for the existence of the given file. |
| Method | |
Grow the file |
| Method | |
Move file to a location inside the file storage dir. |
| Method | |
Remove the file backing the block device. |
| Method | |
Return the actual disk size in bytes. |
| Instance Variable | file |
Undocumented |
| Instance Variable | path |
Undocumented |
@classmethod
def CreateFile(cls, path, size, create_folders=False, _file_path_acceptance_fn=None): ¶
def CreateFile(cls, path, size, create_folders=False, _file_path_acceptance_fn=None): ¶
Create a new file and its file device helper.
| Parameters | |
| path | Undocumented |
| size | the size in MiBs the file should be truncated to. |
| create | create the directories for the path if necessary (using ganeti.utils.io.Makedirs) |
| _file | Undocumented |
| Returns | |
| FileDeviceHelper | The FileDeviceHelper object representing the object. |
| Raises | |
errors.FileStoragePathError | if the file path is disallowed by policy |
Create a new file device helper.
| Raises | |
errors.FileStoragePathError | if the file path is disallowed by policy |
Check for the existence of the given file.
| Parameters | |
| assert | creates an assertion on the result value:
|
| Returns | |
| boolean | True if the file exists |
Grow the file
| Parameters | |
| amount | the amount (in mebibytes) to grow by. |
| dryrun | Undocumented |
| backingstore | Undocumented |
| _excl | Undocumented |