diff --git a/extensions/lifecycle/LifecycleQueuePopulator.js b/extensions/lifecycle/LifecycleQueuePopulator.js index d41f9ad06..efc16b2d2 100644 --- a/extensions/lifecycle/LifecycleQueuePopulator.js +++ b/extensions/lifecycle/LifecycleQueuePopulator.js @@ -7,7 +7,7 @@ const { mpuBucketPrefix } = constants; const QueuePopulatorExtension = require('../../lib/queuePopulator/QueuePopulatorExtension'); const { authTypeAssumeRole } = require('../../lib/constants'); -const uuid = require('uuid/v4'); +const { v4 } = require('uuid'); const safeJsonParse = require('./util/safeJsonParse'); const { LifecycleMetrics } = require('./LifecycleMetrics'); const LIFECYCLE_BUCKETS_ZK_PATH = '/data/buckets'; @@ -322,7 +322,7 @@ class LifecycleQueuePopulator extends QueuePopulatorExtension { objectKey: value.key, objectVersion: version, archiveInfo: value.archive.archiveInfo, - requestId: uuid(), + requestId: v4(), eTag: value['content-md5'], transitionTime: transitionTime.toISOString(), accountId, @@ -366,7 +366,7 @@ class LifecycleQueuePopulator extends QueuePopulatorExtension { restoreWillExpireAt: expiryDate.toISOString(), }, updatedAt: md['last-modified'], - requestId: uuid(), + requestId: v4(), }); const coldLocation = md['x-amz-storage-class']; diff --git a/extensions/replication/tasks/CopyLocationTask.js b/extensions/replication/tasks/CopyLocationTask.js index 5a7471dc1..52ae35795 100644 --- a/extensions/replication/tasks/CopyLocationTask.js +++ b/extensions/replication/tasks/CopyLocationTask.js @@ -1,5 +1,5 @@ const async = require('async'); -const uuid = require('uuid/v4'); +const { v4 } = require('uuid'); const { errors, jsutil, models } = require('arsenal'); const { ObjectMD } = models; @@ -614,7 +614,7 @@ class CopyLocationTask extends BackbeatTask { _initiateMPU(actionEntry, objMD, log, cb) { // If using Azure backend, create a unique ID to use as the block ID. if (this._getReplicationEndpointType() === 'azure') { - const uploadId = uuid().replace(/-/g, ''); + const uploadId = v4().replace(/-/g, ''); return setImmediate(() => cb(null, uploadId)); } const { bucket, key, version } = actionEntry.getAttribute('target'); diff --git a/extensions/replication/tasks/MultipleBackendTask.js b/extensions/replication/tasks/MultipleBackendTask.js index 2d98aa2e2..d5dc804c5 100644 --- a/extensions/replication/tasks/MultipleBackendTask.js +++ b/extensions/replication/tasks/MultipleBackendTask.js @@ -1,5 +1,5 @@ const async = require('async'); -const uuid = require('uuid/v4'); +const { v4 } = require('uuid'); const errors = require('arsenal').errors; const jsutil = require('arsenal').jsutil; @@ -471,7 +471,7 @@ class MultipleBackendTask extends ReplicateObject { _initiateMPU(sourceEntry, log, cb) { // If using Azure backend, create a unique ID to use as the block ID. if (this._getReplicationEndpointType() === 'azure') { - const uploadId = uuid().replace(/-/g, ''); + const uploadId = v4().replace(/-/g, ''); return setImmediate(() => cb(null, uploadId)); } const destReq = this.backbeatSource.multipleBackendInitiateMPU({ diff --git a/lib/models/ActionQueueEntry.js b/lib/models/ActionQueueEntry.js index 825648dc4..edd1b2085 100644 --- a/lib/models/ActionQueueEntry.js +++ b/lib/models/ActionQueueEntry.js @@ -1,4 +1,4 @@ -const uuid = require('uuid/v4'); +const { v4 } = require('uuid'); const errors = require('arsenal').errors; @@ -52,7 +52,7 @@ class ActionQueueEntry { */ static create(actionType) { return new ActionQueueEntry({ - actionId: uuid(), + actionId: v4(), action: actionType, }); }