zhmcclient / zhmccli

A CLI for the IBM Z HMC
Apache License 2.0
10 stars 9 forks source link

Fixed incorrect representation of string values as floating point numbers #405

Closed andy-maier closed 1 year ago

andy-maier commented 1 year ago

Here is an example for the change for the serial number of a CPC (which was the original error reported in issue #391):

Incorrect output as floating point value with the master branch:

$ zhmc cpc list
+--------+----------+---------------+--------------+----------------+-----------------+-------------------------+
| name   | status   | dpm-enabled   | se-version   |   machine-type | machine-model   |   machine-serial-number |
|--------+----------+---------------+--------------+----------------+-----------------+-------------------------|
| CPCA   | active   | True          | 2.15.0       |           8562 | GT2             |             2.00406e+13 |
+--------+----------+---------------+--------------+----------------+-----------------+-------------------------+

Correct output with this PR:

$ zhmc cpc list
+--------+----------+---------------+--------------+----------------+-----------------+-------------------------+
| name   | status   | dpm-enabled   | se-version   | machine-type   | machine-model   | machine-serial-number   |
|--------+----------+---------------+--------------+----------------+-----------------+-------------------------|
| CPCA   | active   | True          | 2.15.0       | 8562           | GT2             | 0000200406E8            |
+--------+----------+---------------+--------------+----------------+-----------------+-------------------------+

Note that the fix also influenced the machine-type column which property-wise is a string and before the fix incorrectly was interpreted as an integer, which by default is right-aligned. With the fix, the property types returned by the HMC are now respected.

EdGue42 commented 1 year ago

Can you give an example on "current" versus "changed" output? (just nervous because we recently ran into 2.0 ... not being the same as 2 json-wise.

coveralls commented 1 year ago

Coverage Status

Coverage: 31.649%. Remained the same when pulling cfb8dbd438bfe62873cbc6c38519572568c83466 on andy/fix-exponential-serial into d29b807d779b852a724d4dbc4ef20ce990d7add3 on master.

andy-maier commented 1 year ago

@EdGue42 I have added details to the description.