Skip to content

Commit ba9e8d8

Browse files
authored
Merge pull request #9203 from tangledbytes/utkarsh/fix/taskid
[GLACIER] Fix task ID regex
2 parents 6d6d17b + 667baeb commit ba9e8d8

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

src/sdk/glacier_tapecloud.js

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,9 @@ class TapeCloudUtils {
120120

121121
// Find the line in the stdout which has the line 'task ID is, <id>' and extract id
122122
// ID in latest version must look like 1005:1111:4444
123-
let match = stdout.match(/task ID is (\d+:\d+:\d+)/);
124-
if (!match || match.length !== 2) {
125-
// Fallback to the older task ID extraction in case we fail to extract new one
126-
match = stdout.match(/task ID is (\d+)/);
127-
if (!match || match.length !== 2) {
128-
throw error;
129-
}
123+
const match = stdout.match(/task ID is ([\w]+(:[\w]+)*)/);
124+
if (!match || match.length < 2) {
125+
throw error;
130126
}
131127

132128
const task_id = match[1];
@@ -196,9 +192,9 @@ class TapeCloudUtils {
196192

197193
class TapeCloudGlacier extends Glacier {
198194
/**
199-
* @param {nb.NativeFSContext} fs_context
200-
* @param {LogFile} log_file
201-
* @param {(entry: string) => Promise<void>} failure_recorder
195+
* @param {nb.NativeFSContext} fs_context
196+
* @param {LogFile} log_file
197+
* @param {(entry: string) => Promise<void>} failure_recorder
202198
* @returns {Promise<boolean>}
203199
*/
204200
async stage_migrate(fs_context, log_file, failure_recorder) {
@@ -265,9 +261,9 @@ class TapeCloudGlacier extends Glacier {
265261
}
266262

267263
/**
268-
* @param {nb.NativeFSContext} fs_context
269-
* @param {LogFile} log_file
270-
* @param {(entry: string) => Promise<void>} failure_recorder
264+
* @param {nb.NativeFSContext} fs_context
265+
* @param {LogFile} log_file
266+
* @param {(entry: string) => Promise<void>} failure_recorder
271267
* @returns {Promise<boolean>}
272268
*/
273269
async migrate(fs_context, log_file, failure_recorder) {
@@ -311,9 +307,9 @@ class TapeCloudGlacier extends Glacier {
311307
}
312308

313309
/**
314-
* @param {nb.NativeFSContext} fs_context
315-
* @param {LogFile} log_file
316-
* @param {(entry: string) => Promise<void>} failure_recorder
310+
* @param {nb.NativeFSContext} fs_context
311+
* @param {LogFile} log_file
312+
* @param {(entry: string) => Promise<void>} failure_recorder
317313
* @returns {Promise<boolean>}
318314
*/
319315
async stage_restore(fs_context, log_file, failure_recorder) {
@@ -375,9 +371,9 @@ class TapeCloudGlacier extends Glacier {
375371
}
376372

377373
/**
378-
* @param {nb.NativeFSContext} fs_context
379-
* @param {LogFile} log_file
380-
* @param {(entry: string) => Promise<void>} failure_recorder
374+
* @param {nb.NativeFSContext} fs_context
375+
* @param {LogFile} log_file
376+
* @param {(entry: string) => Promise<void>} failure_recorder
381377
* @returns {Promise<boolean>}
382378
*/
383379
async restore(fs_context, log_file, failure_recorder) {

0 commit comments

Comments
 (0)