fix(xo-web,xo-server#probeIscsiLuns): handle undefined lun size (#5212)
See xoa-support#2815 See https://xcp-ng.org/forum/topic/3409/getting-error-when-trying-to-mount-iscsi-lun
This commit is contained in:
parent
846eff4984
commit
edaae02892
@ -13,6 +13,8 @@
|
|||||||
|
|
||||||
> Users must be able to say: “I had this issue, happy to know it's fixed”
|
> Users must be able to say: “I had this issue, happy to know it's fixed”
|
||||||
|
|
||||||
|
- [New SR] Fix `Cannot read property 'trim' of undefined` error (PR [#5212](https://github.com/vatesfr/xen-orchestra/pull/5212))
|
||||||
|
|
||||||
### Packages to release
|
### Packages to release
|
||||||
|
|
||||||
> Packages will be released in the order they are here, therefore, they should
|
> Packages will be released in the order they are here, therefore, they should
|
||||||
@ -31,3 +33,4 @@
|
|||||||
> In case of conflict, the highest (lowest in previous list) `$version` wins.
|
> In case of conflict, the highest (lowest in previous list) `$version` wins.
|
||||||
|
|
||||||
- xo-web minor
|
- xo-web minor
|
||||||
|
- xo-server patch
|
||||||
|
@ -719,7 +719,7 @@ export async function probeIscsiLuns({
|
|||||||
id: lun.LUNid.trim(),
|
id: lun.LUNid.trim(),
|
||||||
vendor: lun.vendor.trim(),
|
vendor: lun.vendor.trim(),
|
||||||
serial: lun.serial.trim(),
|
serial: lun.serial.trim(),
|
||||||
size: lun.size.trim(),
|
size: lun.size?.trim(),
|
||||||
scsiId: lun.SCSIid.trim(),
|
scsiId: lun.SCSIid.trim(),
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -82,6 +82,7 @@ const messages = {
|
|||||||
upgradesAvailable: 'Upgrades available',
|
upgradesAvailable: 'Upgrades available',
|
||||||
advancedSettings: 'Advanced settings',
|
advancedSettings: 'Advanced settings',
|
||||||
txChecksumming: 'TX checksumming',
|
txChecksumming: 'TX checksumming',
|
||||||
|
unknownSize: 'Unknown size',
|
||||||
|
|
||||||
// ----- Modals -----
|
// ----- Modals -----
|
||||||
alertOk: 'OK',
|
alertOk: 'OK',
|
||||||
|
@ -144,6 +144,7 @@ class SelectIqn extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@injectIntl
|
||||||
class SelectLun extends Component {
|
class SelectLun extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
onChange: PropTypes.func.isRequired,
|
onChange: PropTypes.func.isRequired,
|
||||||
@ -152,11 +153,14 @@ class SelectLun extends Component {
|
|||||||
|
|
||||||
_getOptions = createSelector(
|
_getOptions = createSelector(
|
||||||
() => this.props.options,
|
() => this.props.options,
|
||||||
options =>
|
() => this.props.intl.formatMessage,
|
||||||
|
(options, formatMessage) =>
|
||||||
map(options, (lun, index) => ({
|
map(options, (lun, index) => ({
|
||||||
label: `LUN ${lun.id}: ${lun.serial} - ${formatSize(+lun.size)} - (${
|
label: `LUN ${lun.id}: ${lun.serial} - ${
|
||||||
lun.vendor
|
lun.size !== undefined
|
||||||
})`,
|
? formatSize(+lun.size)
|
||||||
|
: formatMessage(messages.unknownSize)
|
||||||
|
} - (${lun.vendor})`,
|
||||||
value: index,
|
value: index,
|
||||||
}))
|
}))
|
||||||
)
|
)
|
||||||
@ -989,7 +993,11 @@ export default class New extends Component {
|
|||||||
{type === 'iscsi' && (
|
{type === 'iscsi' && (
|
||||||
<dl className='dl-horizontal'>
|
<dl className='dl-horizontal'>
|
||||||
<dt>{_('newSrSize')}</dt>
|
<dt>{_('newSrSize')}</dt>
|
||||||
<dd>{formatSize(+lun.size)}</dd>
|
<dd>
|
||||||
|
{lun.size !== undefined
|
||||||
|
? formatSize(+lun.size)
|
||||||
|
: _('unknownSize')}
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
)}
|
)}
|
||||||
{includes(['nfs', 'hba'], type) && (
|
{includes(['nfs', 'hba'], type) && (
|
||||||
|
Loading…
Reference in New Issue
Block a user