summaryrefslogtreecommitdiffstats
path: root/ipalib/parameters.py
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2009-11-05 16:15:47 +0100
committerJason Gerard DeRose <jderose@redhat.com>2009-11-06 16:05:31 -0700
commit566a3cb9722233b4ee92ef55db5a04dc0f26ee9d (patch)
tree0215e8e5f942e2038a9ca45c5b68859dcea60fe1 /ipalib/parameters.py
parentda58b0cc75ffd59e34729d3caedaa715d8dd2584 (diff)
downloadfreeipa-566a3cb9722233b4ee92ef55db5a04dc0f26ee9d.tar.gz
freeipa-566a3cb9722233b4ee92ef55db5a04dc0f26ee9d.tar.xz
freeipa-566a3cb9722233b4ee92ef55db5a04dc0f26ee9d.zip
Add 'File' parameter type.
Accepts filenames and loads file contents as parameter value.
Diffstat (limited to 'ipalib/parameters.py')
-rw-r--r--ipalib/parameters.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/ipalib/parameters.py b/ipalib/parameters.py
index 819a158ff..0630915cb 100644
--- a/ipalib/parameters.py
+++ b/ipalib/parameters.py
@@ -1254,6 +1254,18 @@ class List(Param):
return
+class File(Str):
+ """
+ File parameter type.
+
+ Accepts file names and loads their content into the parameter value.
+ """
+ kwargs = Str.kwargs + (
+ # valid for CLI, other backends (e.g. webUI) can ignore this
+ ('stdin_if_missing', bool, False),
+ )
+
+
class GeneralizedTime(Str):
"""
Generalized time parameter type.