From 540bd541df0a75283349561868d640500f7b1da0 Mon Sep 17 00:00:00 2001 From: jysperm Date: Fri, 19 Dec 2014 19:52:05 +0800 Subject: [PATCH] fix test of Node --- core/interface/Node.coffee | 4 +++- sample/core.config.coffee | 3 +++ sample/rpvhost.config.coffee | 3 +++ sample/shadowsocks.config.coffee | 3 +++ test/env.coffee | 2 +- 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/core/interface/Node.coffee b/core/interface/Node.coffee index 72f94a8..e6e9f83 100644 --- a/core/interface/Node.coffee +++ b/core/interface/Node.coffee @@ -2,6 +2,8 @@ {config, logger} = app {available_plugins} = config.plugin +id_key = fs.readFileSync config.ssh.id_key + module.exports = class Node name: '' master: false @@ -117,7 +119,7 @@ module.exports = class Node connection.connect host: @info.host username: 'rpadmin' - privateKey: fs.readFileSync '/home/rpadmin/.ssh/id_rsa' + privateKey: id_key runCommandRemote: (command, callback) -> @execRemote command, {}, callback diff --git a/sample/core.config.coffee b/sample/core.config.coffee index 0059472..56c181e 100644 --- a/sample/core.config.coffee +++ b/sample/core.config.coffee @@ -49,6 +49,9 @@ module.exports = billing: {} + ssh: + id_key: '/home/rpadmin/.ssh/id_rsa' + nodes: master: host: 'localhost' diff --git a/sample/rpvhost.config.coffee b/sample/rpvhost.config.coffee index 8f2b5cc..0aeffa5 100644 --- a/sample/rpvhost.config.coffee +++ b/sample/rpvhost.config.coffee @@ -58,6 +58,9 @@ module.exports = price: 10 / 30 prepaid: true + ssh: + id_key: '/home/rpadmin/.ssh/id_rsa' + nodes: master: host: 'localhost' diff --git a/sample/shadowsocks.config.coffee b/sample/shadowsocks.config.coffee index 8906b88..41d890a 100644 --- a/sample/shadowsocks.config.coffee +++ b/sample/shadowsocks.config.coffee @@ -46,6 +46,9 @@ module.exports = bucket: 100 * 1000 * 1000 price: 0.06 + ssh: + id_key: '/home/rpadmin/.ssh/id_rsa' + nodes: master: host: 'localhost' diff --git a/test/env.coffee b/test/env.coffee index 7ca0929..74a42bd 100644 --- a/test/env.coffee +++ b/test/env.coffee @@ -40,8 +40,8 @@ config.web.listen = 12558 if process.env.TRAVIS == 'true' config.mongodb.user = undefined config.mongodb.password = undefined - config.redis.password = undefined + config.ssh.id_key = '/home/travis-ci/.ssh/id_rsa' global.isPluginEnable = (name) -> return name in config.plugin.available_plugins