Douglas Schilling Landgraf has uploaded a new change for review. Change subject: valid: add file:// validator ......................................................................
valid: add file:// validator Users can specify file:// to point to a file. Change-Id: I70f0c92ff91e7a8d8f3e6eeefd2dfa15a1a61271 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1331072 Signed-off-by: Douglas Schilling Landgraf <[email protected]> --- M src/ovirt/node/valid.py 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/23/57223/1 diff --git a/src/ovirt/node/valid.py b/src/ovirt/node/valid.py index 48f77ba..79e5d26 100644 --- a/src/ovirt/node/valid.py +++ b/src/ovirt/node/valid.py @@ -326,6 +326,10 @@ FQDNLength()(value) return is_valid +class FileURL(Validator): + description = "a valid file URL" + def validate(self, value): + return value.startswith("file://") and os.path.isfile(value[7:]) class Ascii(Validator): """ Checks if the param is ascii or not. -- To view, visit https://gerrit.ovirt.org/57223 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I70f0c92ff91e7a8d8f3e6eeefd2dfa15a1a61271 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-node Gerrit-Branch: master Gerrit-Owner: Douglas Schilling Landgraf <[email protected]> _______________________________________________ node-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/node-patches
