@f5devcentral/f5-cloud-libs
Advanced tools
Comparing version 4.26.1 to 4.26.2
@@ -412,3 +412,3 @@ /** | ||
Object.assign(methodOptions, options); | ||
let finalPath = path; | ||
let finalPath; | ||
let partitionPath; | ||
@@ -447,2 +447,3 @@ | ||
); | ||
finalPath = path; | ||
this.logger.debug('create', this.host, finalPath, body); | ||
@@ -449,0 +450,0 @@ } |
{ | ||
"name": "@f5devcentral/f5-cloud-libs", | ||
"version": "4.26.1", | ||
"version": "4.26.2", | ||
"description": "Common library code and scripts for deploying a BIG-IP in a cloud environment", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
# Release notes | ||
## Release 4.26.2 | ||
* Fix race condition between createOrModify and MCPD where MCPD first reports an object exists but it has already been deleted. | ||
## Release 4.26.1 | ||
@@ -4,0 +7,0 @@ * Add failOnErrorMessages and failOnErrorCodes which are arrays of strings/regexes and integers, respectively. That prevent the retry logic from running. Effectively allowing for an early exit of specific failures. |
@@ -23,2 +23,3 @@ /** | ||
const childProcessMock = require('child_process'); | ||
const sinon = require('sinon'); | ||
@@ -98,2 +99,3 @@ describe('bigip tests', () => { | ||
afterEach(() => { | ||
sinon.restore(); | ||
Object.keys(require.cache).forEach((key) => { | ||
@@ -358,2 +360,36 @@ delete require.cache[key]; | ||
}); | ||
describe('race condition test', () => { | ||
let modifyPath; | ||
it('should update path if object exists first but then goes away', () => { | ||
sinon.stub(icontrolMock, 'modify').onFirstCall().callsFake((path, opts) => { | ||
modifyPath = path; | ||
icontrolMock.recordRequest('list', path, null, opts); | ||
const err = new Error(); | ||
err.code = 404; | ||
return Promise.reject(err); | ||
}); | ||
sinon.stub(icontrolMock, 'list') | ||
.onFirstCall() | ||
.callsFake((path, opts) => { | ||
icontrolMock.recordRequest('list', path, null, opts); | ||
return Promise.resolve({}); | ||
}) | ||
.onSecondCall() | ||
.callsFake((path, opts) => { | ||
icontrolMock.recordRequest('list', path, null, opts); | ||
const err = new Error(); | ||
err.code = 404; | ||
return Promise.reject(err); | ||
}); | ||
return bigIp.createOrModify('/this/will/go/away', { name: 'bar' }, null, utilMock.SHORT_RETRY) | ||
.then(() => { | ||
assert.strictEqual(modifyPath, '/this/will/go/away/~Common~bar'); | ||
assert.strictEqual(icontrolMock.lastCall.method, 'create'); | ||
assert.strictEqual(icontrolMock.lastCall.path, '/this/will/go/away'); | ||
}); | ||
}); | ||
}); | ||
}); | ||
@@ -360,0 +396,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
3216443
32447