This commit is contained in:
William Mantly 2016-01-30 01:54:50 -05:00
parent 5854426e7e
commit 003895079d
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){
var command = 'lxc-start-ephemeral -o '+base_name+ ' -n '+name +' --union-type overlayfs -d';
return sysExec(command, function(data){
console.log('startEphemeral', arguments);
if(data.match("doesn't exist.")){
return callback({status: 500, error: "doesn't exist."});
}
@ -63,6 +64,7 @@ var lxc = {
info: function(name, callback){
return sysExec('lxc-info -n '+name, function(data){
console.log('info', arguments);
if(data.match("doesn't exist")){
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){
lxc.info(req.params.name, function(data){
console.log('info', arguments);
res.json(data);
});
});
router.get('/list', function(req, res, next) {
lxc.list(function(data){
console.log('list', arguments);
res.json(data);
});
});