summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJannik Schönartz2022-02-16 20:59:46 +0100
committerJannik Schönartz2022-02-16 20:59:46 +0100
commita7ff87f904d8f44d91116d991c57d56d4c8c2da6 (patch)
tree6b39569c153b3b54d2fc34bffe42f837ffbce41b
parent[server/backends/idoit] Use blade-chassis instead of rack segmentation (diff)
downloadbas-a7ff87f904d8f44d91116d991c57d56d4c8c2da6.tar.gz
bas-a7ff87f904d8f44d91116d991c57d56d4c8c2da6.tar.xz
bas-a7ff87f904d8f44d91116d991c57d56d4c8c2da6.zip
[server/backends/idoit] 0 as bay was seen as undefined, rackunits fallback to 2
-rw-r--r--server/lib/external-backends/backends/idoit-backend.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/server/lib/external-backends/backends/idoit-backend.js b/server/lib/external-backends/backends/idoit-backend.js
index 9632aa8..32d216d 100644
--- a/server/lib/external-backends/backends/idoit-backend.js
+++ b/server/lib/external-backends/backends/idoit-backend.js
@@ -796,7 +796,7 @@ class IdoitBackend extends ExternalBackends {
*/
// Update the object location.
- if (client.parentId && (!client.location || (client.location && !client.location.bay))) {
+ if (client.parentId && (!client.location || (client.location && isNaN(client.location.bay)))) {
// Either client or no slot was set
let locationData = {
'parent': client.parentId
@@ -817,7 +817,7 @@ class IdoitBackend extends ExternalBackends {
// Create segments and prepare bay
// Rack segmentation
- if (!!client.location && !!client.location.slot && !!client.location.bay) {
+ if (!!client.location && !!client.location.slot && !isNaN(client.location.bay)) {
// Get the parentId if none was given
if (!client.parentId) {
let boundedLocation = boundObjects.filter(response => response.id.startsWith('READ_C__CATG__LOCATION'))
@@ -1025,7 +1025,9 @@ class IdoitBackend extends ExternalBackends {
'object': chassisId,
'objID': chassisId,
'category': 'C__CATG__FORMFACTOR',
- 'data': { 'rackunits': client.formfactor.rackunits }
+ 'data': {
+ 'rackunits': client.formfactor ? client.formfactor.rackunits : 2
+ }
}, 'set_segment_size')
await this.axiosRequest(credentials.url, [setSegmentSizeParams], headers)