module documentation
Filesystem-based access functions and disk templates.
| Class | |
No class docstring; 0/2 instance variable, 6/6 methods, 1/1 class method documented |
| Class | |
File device. |
| Function | |
Checks whether the path exists and is acceptable to use. |
| Function | |
Checks if a path is allowed for file storage. |
| Function | |
Returns a list of file storage paths whose prefix is considered bad. |
| Function | |
Retrieves the free and total space of the device where the file is located. |
| Function | _ |
Checks if a path is in a list of allowed paths for file storage. |
| Function | _ |
Checks whether the given path is usable on the file system. |
| Function | _ |
Cross-checks a list of paths for prefixes considered bad. |
| Function | _ |
Builds a list of path prefixes which shouldn't be used for file storage. |
| Function | _ |
Loads file containing allowed file storage paths. |
Checks whether the path exists and is acceptable to use.
Can be used for any file-based storage, for example shared-file storage.
| Parameters | |
| path:string | path to check |
| _allowed | Undocumented |
| Returns | |
| string | error message if the path is not ready to use |
def CheckFileStoragePathAcceptance(path, _filename=pathutils.FILE_STORAGE_PATHS_FILE, exact_match_ok=False):
¶
Checks if a path is allowed for file storage.
| Parameters | |
| path:string | Path to check |
| _filename | Undocumented |
| exact | Undocumented |
| Raises | |
errors.FileStoragePathError | If the path is not allowed |
Retrieves the free and total space of the device where the file is located.
| Parameters | |
| path:string | Path of the file whose embracing device's capacity is reported. |
| Returns | |
| a dictionary containing 'vg_size' and 'vg_free' given in MebiBytes | |
Checks if a path is in a list of allowed paths for file storage.
| Parameters | |
| path:string | Path to check |
| allowed:list | List of allowed paths |
| exact | whether or not it is okay when the path is exactly equal to an allowed path and not a subdir of it |
| Raises | |
errors.FileStoragePathError | If the path is not allowed |
Checks whether the given path is usable on the file system.
This checks wether the path is existing, a directory and writable.
| Parameters | |
| path:string | path to check |
Cross-checks a list of paths for prefixes considered bad.
Some paths, e.g. "/bin", should not be used for file storage.
| Parameters | |
| paths:list | List of paths to be checked |
| _forbidden | Undocumented |
| Returns | |
| list | Sorted list of paths for which the user should be warned |
Builds a list of path prefixes which shouldn't be used for file storage.
| Returns | |
| frozenset | Undocumented |