Skip to content

Commit

Permalink
null is also defined
Browse files Browse the repository at this point in the history
if (typeof null != "undefined") console.log('could be that this is the test node-etcd is using');
  • Loading branch information
celevra committed May 6, 2016
1 parent 98a9cec commit 2e8e3ec
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/etcd.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ var MAX_TRIES = 3;
var BACKOFF = 2;

var endpoints = [];
var sslopts = null;
if(!process.env.ETCD_ENDPOINTS) {
endpoints.push('127.0.0.1:4001');
} else {
Expand All @@ -19,7 +18,7 @@ if(!process.env.ETCD_ENDPOINTS) {
});

if(ssl) {
sslopts = {
var sslopts = {
ca: fs.readFileSync(process.env.ETCD_CAFILE),
cert: fs.readFileSync(process.env.ETCD_CERTFILE),
key: fs.readFileSync(process.env.ETCD_KEYFILE),
Expand All @@ -30,7 +29,10 @@ if(!process.env.ETCD_ENDPOINTS) {

console.log('Etcd peers:', process.env.ETCD_ENDPOINTS);

var etcd = new Etcd(endpoints, sslopts);
if (ssl)
var etcd = new Etcd(endpoints, sslopts);
else
var etcd = new Etcd(endpoints);

// mixin some useful methods
function deepFindKeys(node, regexp) {
Expand Down

0 comments on commit 2e8e3ec

Please sign in to comment.