vatesfr / xen-orchestra

The global orchestration solution to manage and backup XCP-ng and XenServer.
https://xen-orchestra.com
Other
791 stars 266 forks source link

HBA discovery fails to display the result because size is given back as String to formatSize #3805

Closed shayanoh closed 5 years ago

shayanoh commented 5 years ago

Context

Expected behavior

When adding an HBA storage, after scanning for storages, list of all discovered HBAs must appear

Current behavior

The HBA size is given back as string. This is an anonymized response from my server:

{"id":-9007199254740977,"jsonrpc":"2.0","result":[{"hba":"lpfc","path":"/dev/sdr [sdf] [sdab] [sdal]","scsiId":"[redacted]","size":"5395610861568","vendor":"HP"}]}

The value of size is given to formatSize in this file: packages\xo-web\src\xo-app\new\sr\index.js @ 59 and this throws an exception since formatSize expects an integer.

The solution I propose is to add parseInt to the function call. I could create a pull request in a few days if no one else can right now.

shayanoh commented 5 years ago

I've created a pull request for this on #3806