summaryrefslogtreecommitdiffstats
path: root/make-lint
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2012-01-17 11:19:00 +0100
committerMartin Kosek <mkosek@redhat.com>2012-01-20 08:13:44 +0100
commit092dd8db1293599a4b7f0ab33ea43e8082ec554f (patch)
tree4de216fe1b4a69f8d2acb4550dee8716dd1e0b53 /make-lint
parentd906fa50c1fd56ceb1a602fe50129becb6a304d4 (diff)
downloadfreeipa-092dd8db1293599a4b7f0ab33ea43e8082ec554f.tar.gz
freeipa-092dd8db1293599a4b7f0ab33ea43e8082ec554f.tar.xz
freeipa-092dd8db1293599a4b7f0ab33ea43e8082ec554f.zip
Replace float with Decimal
Having float type as a base type for floating point parameters in ipalib introduces several issues, e.g. problem with representation or value comparison. Python language provides a Decimal type which help overcome these issues. This patch replaces a float type and Float parameter with a decimal.Decimal type in Decimal parameter. A precision attribute was added to Decimal parameter that can be used to limit a number of decimal places in parameter representation. This approach fixes a problem with API.txt validation where comparison of float values may fail on different architectures due to float representation error. In order to safely transfer the parameter value over RPC it is being converted to string which is then converted back to decimal.Decimal number on a server side. https://fedorahosted.org/freeipa/ticket/2260
Diffstat (limited to 'make-lint')
-rwxr-xr-xmake-lint2
1 files changed, 1 insertions, 1 deletions
diff --git a/make-lint b/make-lint
index ef2414970..5826c3229 100755
--- a/make-lint
+++ b/make-lint
@@ -61,7 +61,7 @@ class IPATypeChecker(TypeChecker):
'sortorder', 'csv', 'csv_separator', 'csv_skipspace'],
'ipalib.parameters.Bool': ['truths', 'falsehoods'],
'ipalib.parameters.Int': ['minvalue', 'maxvalue'],
- 'ipalib.parameters.Float': ['minvalue', 'maxvalue'],
+ 'ipalib.parameters.Decimal': ['minvalue', 'maxvalue', 'precision'],
'ipalib.parameters.Data': ['minlength', 'maxlength', 'length',
'pattern', 'pattern_errmsg'],
'ipalib.parameters.Enum': ['values'],