@f5devcentral/f5-cloud-libs
Advanced tools
Comparing version 4.13.5 to 4.13.6
@@ -697,4 +697,6 @@ /** | ||
* | ||
* @param {Object} provisionSettings - Object map of module to provisioning level | ||
* ['dedicated', 'nominial', 'minimum', 'none'] | ||
* @param {Object} provisionSettings - Object map of module to provisioning level | ||
* ['dedicated', 'nominial', 'minimum', 'none'] | ||
* @param {Object} [options] - Optional parameters. | ||
* @param {Boolean} [options.checkActive] - Checks for active BIG-IP after provisioning. Default true. | ||
* | ||
@@ -704,6 +706,10 @@ * @returns {Promise} A promise which is resolved when the modules have | ||
*/ | ||
BigIpOnboard.prototype.provision = function provision(provisionSettings) { | ||
BigIpOnboard.prototype.provision = function provision(provisionSettings, options) { | ||
const modulesToProvision = Object.keys(provisionSettings); | ||
const PROVISION_PATH = '/tm/sys/provision/'; | ||
const DELAY_BETWEEN_PROVISION_COMMANDS = 1000; | ||
const methodOptions = { | ||
checkActive: true | ||
}; | ||
Object.assign(methodOptions, options); | ||
@@ -756,3 +762,3 @@ if (modulesToProvision.length > 0) { | ||
// if provisioning, check for active after last module | ||
if (provisioningCommands.length > 0) { | ||
if (methodOptions.checkActive && provisioningCommands.length > 0) { | ||
provisioningCommands.push({ | ||
@@ -759,0 +765,0 @@ promise: this.core.active |
{ | ||
"name": "@f5devcentral/f5-cloud-libs", | ||
"version": "4.13.5", | ||
"version": "4.13.6", | ||
"description": "Common library code and scripts for deploying a BIG-IP in a cloud environment", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1111,2 +1111,53 @@ /** | ||
}); | ||
}, | ||
testNoActiveCheck(test) { | ||
const provisionSettings = { | ||
mod1: 'level2' | ||
}; | ||
icontrolMock.when( | ||
'list', | ||
'/tm/sys/provision/', | ||
[ | ||
{ | ||
name: 'mod1', | ||
level: 'level1' | ||
} | ||
] | ||
); | ||
icontrolMock.when( | ||
'list', | ||
'/tm/cm/failover-status', | ||
{ | ||
entries: { | ||
'https://localhost/mgmt/tm/cm/failover-status/0': { | ||
nestedStats: { | ||
entries: { | ||
status: { | ||
description: 'OFFLINE' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
); | ||
bigIp.onboard.provision(provisionSettings, { checkActive: false }) | ||
.then(() => { | ||
test.deepEqual( | ||
icontrolMock.getRequest('modify', '/tm/sys/provision/mod1'), | ||
{ | ||
level: 'level2' | ||
} | ||
); | ||
}) | ||
.catch((err) => { | ||
test.ok(false, err.message); | ||
}) | ||
.finally(() => { | ||
test.done(); | ||
}); | ||
} | ||
@@ -1113,0 +1164,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3186417
155
33347