joyent/node-triton#180 triton profile docker-setup
fails with a non-MD5 keyId
Reviewed by: Todd Whiteman <todd.whiteman@joyent.com> Approved by: Todd Whiteman <todd.whiteman@joyent.com>
This commit is contained in:
parent
dba8915d4f
commit
46ded211f3
@ -259,6 +259,7 @@ function _createProfile(opts, cb) {
|
|||||||
}, {
|
}, {
|
||||||
desc: keyIdDesc,
|
desc: keyIdDesc,
|
||||||
key: 'keyId',
|
key: 'keyId',
|
||||||
|
default: defaults.keyId,
|
||||||
validate: function validateKeyId(value, valCb) {
|
validate: function validateKeyId(value, valCb) {
|
||||||
// First try as a fingerprint.
|
// First try as a fingerprint.
|
||||||
try {
|
try {
|
||||||
|
@ -324,9 +324,10 @@ function profileDockerSetup(opts, cb) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var kr = new auth.KeyRing();
|
var kr = new auth.KeyRing();
|
||||||
kr.list(function (listErr, keyMap) {
|
var profileFp = sshpk.parseFingerprint(tritonapi.profile.keyId);
|
||||||
if (listErr) {
|
kr.find(profileFp, function (findErr, keyPairs) {
|
||||||
next(listErr);
|
if (findErr) {
|
||||||
|
next(findErr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -334,7 +335,6 @@ function profileDockerSetup(opts, cb) {
|
|||||||
* If our keyId was found, and with the 'homedir' plugin, then
|
* If our keyId was found, and with the 'homedir' plugin, then
|
||||||
* we should have access to the private key (modulo unlocking).
|
* we should have access to the private key (modulo unlocking).
|
||||||
*/
|
*/
|
||||||
var keyPairs = keyMap[tritonapi.profile.keyId] || [];
|
|
||||||
var homedirKeyPair;
|
var homedirKeyPair;
|
||||||
for (var i = 0; i < keyPairs.length; i++) {
|
for (var i = 0; i < keyPairs.length; i++) {
|
||||||
if (keyPairs[i].plugin === 'homedir') {
|
if (keyPairs[i].plugin === 'homedir') {
|
||||||
|
Reference in New Issue
Block a user