def nfs_export_remove(req, host, path): found = False for e in Nfs.exports(): if e.host == host and e.path == path: Nfs.export_remove(e) found = True if not found: raise TargetdError(-400, "NFS export to remove not found %s:%s", (host, path))
def nfs_export_add(req, host, path, export_path, options): if export_path is not None: raise TargetdError(-401, "separate export path not supported at " "this time") bit_opt = 0 key_opt = {} for o in options: if '=' in o: k, v = o.split('=') key_opt[k] = v else: bit_opt |= Export.bool_option[o] Nfs.export_add(host, path, bit_opt, key_opt)
def nfs_export_list(req): rc = [] exports = Nfs.exports() for e in exports: rc.append(dict(host=e.host, path=e.path, options=e.options_list())) return rc
def nfs_export_auth_list(req): return Nfs.security_options()