From 0efdb4ffe668bf8eafd478fa60d17aaa391a3086 Mon Sep 17 00:00:00 2001 From: keedya Date: Tue, 3 Apr 2018 10:41:22 -0500 Subject: [PATCH] Add switchconnection to the catalog inventory in wsman --- lib/jobs/dell-wsman-inventory.js | 4 ++-- spec/lib/jobs/dell-wsman-inventory-spec.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 lib/jobs/dell-wsman-inventory.js diff --git a/lib/jobs/dell-wsman-inventory.js b/lib/jobs/dell-wsman-inventory.js old mode 100644 new mode 100755 index 73820eb9..d686dfb4 --- a/lib/jobs/dell-wsman-inventory.js +++ b/lib/jobs/dell-wsman-inventory.js @@ -86,7 +86,7 @@ function DellWsmanInventoryJobFactory( if(self.nodeType === 'enclosure'){ self.inventories = ['details']; } else if(self.nodeType === 'compute'){ - self.inventories = ['hardware', 'software', 'nics', 'manager']; + self.inventories = ['hardware', 'software', 'nics', 'manager', 'switchconnection']; } else { throw new Error('Inventory collection for node type (' + self.nodeType + ') is not implemented.'); } @@ -127,7 +127,7 @@ function DellWsmanInventoryJobFactory( var requestUri = ''; if(self.nodeType === 'compute'){ requestUri = self.dellConfigs.services.inventory.serverCallback; - if(type === 'manager'){ // special case for manager endpoint - use 2.0 api + if(type === 'manager' || type ==='switchconnection'){ // special case for manager endpoint - use 2.0 api requestUri = requestUri.replace(/1.0/, '2.0'); } } else if(self.nodeType === 'enclosure'){ diff --git a/spec/lib/jobs/dell-wsman-inventory-spec.js b/spec/lib/jobs/dell-wsman-inventory-spec.js index 58e2c144..00383af1 100644 --- a/spec/lib/jobs/dell-wsman-inventory-spec.js +++ b/spec/lib/jobs/dell-wsman-inventory-spec.js @@ -100,7 +100,7 @@ describe(require('path').basename(__filename), function() { configuration.get.withArgs('dell').returns(dellConfigs); wsmanBaseJob.prototype.getIpAddress.resolves('172.31.128.73'); return wsmanInventoryJob._initJob().then(function() { - expect(wsmanInventoryJob.inventories.length).to.equal(4); + expect(wsmanInventoryJob.inventories.length).to.equal(5); expect(wsmanInventoryJob.inventories[0]).to.equal('hardware'); }); });