testing
This commit is contained in:
parent
5854426e7e
commit
003895079d
2
lxc.js
2
lxc.js
@ -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'});
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user