Michael Pasternak has posted comments on this change.

Change subject: cli: Don't write .0 suffix for integers
......................................................................


Patch Set 1: Code-Review-1

(1 comment)

http://gerrit.ovirt.org/#/c/26864/1/src/ovirtcli/format/text.py
File src/ovirtcli/format/text.py:

Line 126:         else:
Line 127:             val = str(value)
Line 128: 
Line 129:         # Don't write the .0 suffix for floating point number whose 
value is
Line 130:         # actually an integer:
AFAICS the actual value is float and not int, right way would be casting to 
integer instead of to-string+removing last two chars, also it will not work for 
any float
that has precision larger that 1/10 (one digit after period)

anyway bug complaining about very specific use-case GAUGE in Statistics
object, while your fix wraps all possible floats coming from API to integers 
what is wrong,

the fix should come in API (rather than in all clients) and should be generic 
by casting statistics.value-datum to type defined in statistics.values-type
Line 131:         if type(value) == float and val.endswith('.0'):
Line 132:             val = val[:-2]
Line 133: 
Line 134:         fil = (field if resource_context is None


-- 
To view, visit http://gerrit.ovirt.org/26864
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I21490ec50e3a7433331e981162de800c7d548f27
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-cli
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Ravi Nori <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to