Merge pull request #7 from wmantly/new

testing
This commit is contained in:
William Mantly 2016-01-30 22:22:18 -05:00
commit 270c2f0b26
2 changed files with 2 additions and 2 deletions

2
lxc.js
View File

@ -35,6 +35,7 @@ var lxc = {
startEphemeral: function(name, base_name, callback){ startEphemeral: function(name, base_name, callback){
var command = 'lxc-start-ephemeral -o '+base_name+ ' -n '+name +' --union-type overlayfs -d'; var command = 'lxc-start-ephemeral -o '+base_name+ ' -n '+name +' --union-type overlayfs -d';
return sysExec(command, function(data){ return sysExec(command, function(data){
console.log('startEphemeral', arguments);
if(data.match("doesn't exist.")){ if(data.match("doesn't exist.")){
return callback({status: 500, error: "doesn't exist."}); return callback({status: 500, error: "doesn't exist."});
} }
@ -63,6 +64,7 @@ var lxc = {
info: function(name, callback){ info: function(name, callback){
return sysExec('lxc-info -n '+name, function(data){ return sysExec('lxc-info -n '+name, function(data){
console.log('info', arguments);
if(data.match("doesn't exist")){ if(data.match("doesn't exist")){
return callback({state: 'NULL'}); return callback({state: 'NULL'});
} }

View File

@ -73,14 +73,12 @@ router.get('/destroy/:name', function(req, res, next){
router.get('/info/:name', function(req, res, next){ router.get('/info/:name', function(req, res, next){
lxc.info(req.params.name, function(data){ lxc.info(req.params.name, function(data){
console.log('info', arguments);
res.json(data); res.json(data);
}); });
}); });
router.get('/list', function(req, res, next) { router.get('/list', function(req, res, next) {
lxc.list(function(data){ lxc.list(function(data){
console.log('list', arguments);
res.json(data); res.json(data);
}); });
}); });