summaryrefslogtreecommitdiff
path: root/netconf-service
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-05-23 00:35:11 +0000
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-05-23 00:35:11 +0000
commit05f5755bb193003852f725d2e0aae41c2ac1cd26 (patch)
tree137d15c1d35d37be03def033b7b6afdb86bd41d9 /netconf-service
parentcfd92cb18db476aff65a63321f3e3b20d8b6486f (diff)
downloadinfinitytier-05f5755bb193003852f725d2e0aae41c2ac1cd26.tar.gz
infinitytier-05f5755bb193003852f725d2e0aae41c2ac1cd26.zip
Allow Redis DB# select.
Diffstat (limited to 'netconf-service')
-rw-r--r--netconf-service/config.js3
-rw-r--r--netconf-service/index.js3
2 files changed, 6 insertions, 0 deletions
diff --git a/netconf-service/config.js b/netconf-service/config.js
new file mode 100644
index 00000000..9d817c5a
--- /dev/null
+++ b/netconf-service/config.js
@@ -0,0 +1,3 @@
+//exports.redisDb = 0; // live
+exports.redisDb = 1; // test
+//exports.redisDb = 2; // dev
diff --git a/netconf-service/index.js b/netconf-service/index.js
index c2f4610f..8f7658ab 100644
--- a/netconf-service/index.js
+++ b/netconf-service/index.js
@@ -25,6 +25,8 @@
// LLC. Start here: http://www.zerotier.com/
//
+var config = require('./config.js');
+
// Fields in netconf response dictionary
var ZT_NETWORKCONFIG_DICT_KEY_ALLOWED_ETHERNET_TYPES = "et";
var ZT_NETWORKCONFIG_DICT_KEY_NETWORK_ID = "nwid";
@@ -53,6 +55,7 @@ var async = require('async');
var redis = require('redis');
var DB = redis.createClient();
DB.on("error",function(err) { console.error('redis query error: '+err); });
+DB.select(config.redisDb,function() {});
// Global variables -- these are initialized on startup or netconf-init message
var netconfSigningIdentity = null; // identity of netconf master, with private key portion