From b3442bf88f5186544f0caa307d6a791371662893 Mon Sep 17 00:00:00 2001 From: william Date: Fri, 29 Jan 2016 16:21:07 -0500 Subject: [PATCH] config issue --- lxc.js | 10 +++++++--- package.json | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lxc.js b/lxc.js index 3135f82..e2f1d8c 100644 --- a/lxc.js +++ b/lxc.js @@ -1,6 +1,10 @@ module.exports = function(config){ + var cmd = require('node-cmd'); - var obj = {}; + var sysExec = function(command, callback){ + cmd.get(command, callback) + } +/* var obj = {}; var child = require('child'), sshBind = config.sshBind || false; @@ -34,7 +38,7 @@ module.exports = function(config){ cbClose: function(exitCode){ onClose(exitCode == 0 ? null:exitCode, errors) } }).start(); }; - +*/ obj.create = function(name, template, config, cbComplete, cbData){ sysExec('lxc-create -n '+name+' -t '+template, cbComplete, cbData); @@ -97,7 +101,7 @@ module.exports = function(config){ obj.list = function(cbData){ var output = ''; - sysExec('lxc-ls --fancy', function(data){output+=data}, function(error){ + sysExec('lxc-ls --fancy', function(data){ output = output.split("\n"); var keys = output.splice(0,1)[0].split(/\s+/).slice(0,-1); diff --git a/package.json b/package.json index 79b3cf1..a2505c0 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "redis": "~2.4.2", "child": "0.0.3", "colors": "~1.1.2", - "async": "~1.5.2" + "async": "~1.5.2", + "node-cmd": "~1.1.1" } }