ssh-client-wrapper 2.4.1 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/rsyncExec.js +3 -3
- package/lib/util.js +2 -0
- package/package.json +1 -1
package/lib/rsyncExec.js
CHANGED
|
@@ -7,7 +7,7 @@ const { glob } = require("glob");
|
|
|
7
7
|
const { connect, retryWrapper, sshExec } = require("./sshExec.js");
|
|
8
8
|
const { fork } = require("./fork.js");
|
|
9
9
|
|
|
10
|
-
const { sshCmd, rsyncCmd, getSshOption } = require("./util.js");
|
|
10
|
+
const { sshCmd, rsyncCmd, acceptableRsyncRetrunCodes, getSshOption } = require("./util.js");
|
|
11
11
|
|
|
12
12
|
async function checkRsyncVersion (timeout) {
|
|
13
13
|
const rt = {};
|
|
@@ -79,7 +79,7 @@ async function send (hostInfo, argSrc, dst, rsyncOpt, timeout) {
|
|
|
79
79
|
}
|
|
80
80
|
debug(`send ${src} to ${hostInfo.host}:${dst}`);
|
|
81
81
|
debugVerbose(`send: ${rsyncCmd} ${args.join(" ")}`);
|
|
82
|
-
return retryWrapper(fork.bind(null, hostInfo, rsyncCmd, args, timeout, null,
|
|
82
|
+
return retryWrapper(fork.bind(null, hostInfo, rsyncCmd, args, timeout, null, acceptableRsyncRetrunCodes), hostInfo);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
/**
|
|
@@ -119,7 +119,7 @@ async function recv (hostInfo, argSrc, dst, rsyncOpt, timeout) {
|
|
|
119
119
|
|
|
120
120
|
debug(`recv ${src} to ${dst}`);
|
|
121
121
|
debugVerbose(`recv: ${rsyncCmd} ${args.join(" ")}`);
|
|
122
|
-
return retryWrapper(fork.bind(null, hostInfo, rsyncCmd, args, timeout, null,
|
|
122
|
+
return retryWrapper(fork.bind(null, hostInfo, rsyncCmd, args, timeout, null, acceptableRsyncRetrunCodes), hostInfo);
|
|
123
123
|
}
|
|
124
124
|
module.exports = {
|
|
125
125
|
checkRsyncVersion,
|
package/lib/util.js
CHANGED
|
@@ -6,6 +6,7 @@ const { setTimeout: setTimeoutPromise } = require("timers/promises");
|
|
|
6
6
|
|
|
7
7
|
const sshCmd = "ssh";
|
|
8
8
|
const rsyncCmd = "rsync";
|
|
9
|
+
const acceptableRsyncRetrunCodes = [10, 11, 12, 13, 14];
|
|
9
10
|
|
|
10
11
|
const rePwPrompt = /password:/;
|
|
11
12
|
const rePhPrompt = /Enter passphrase for key/;
|
|
@@ -244,6 +245,7 @@ const watchDogTimer = (timeout, label, cb) => {
|
|
|
244
245
|
module.exports = {
|
|
245
246
|
sshCmd,
|
|
246
247
|
rsyncCmd,
|
|
248
|
+
acceptableRsyncRetrunCodes,
|
|
247
249
|
rePwPrompt,
|
|
248
250
|
rePhPrompt,
|
|
249
251
|
reNewHostPrompt,
|