config issue
This commit is contained in:
		
							
								
								
									
										10
									
								
								lxc.js
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								lxc.js
									
									
									
									
									
								
							@ -1,6 +1,10 @@
 | 
				
			|||||||
module.exports = function(config){
 | 
					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'),
 | 
					    var child = require('child'),
 | 
				
			||||||
        sshBind = config.sshBind || false;
 | 
					        sshBind = config.sshBind || false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -34,7 +38,7 @@ module.exports = function(config){
 | 
				
			|||||||
            cbClose: function(exitCode){ onClose(exitCode == 0 ? null:exitCode,  errors) }
 | 
					            cbClose: function(exitCode){ onClose(exitCode == 0 ? null:exitCode,  errors) }
 | 
				
			||||||
        }).start();
 | 
					        }).start();
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    obj.create = function(name, template, config, cbComplete, cbData){
 | 
					    obj.create = function(name, template, config, cbComplete, cbData){
 | 
				
			||||||
        sysExec('lxc-create -n '+name+' -t '+template, cbComplete, cbData);
 | 
					        sysExec('lxc-create -n '+name+' -t '+template, cbComplete, cbData);
 | 
				
			||||||
@ -97,7 +101,7 @@ module.exports = function(config){
 | 
				
			|||||||
    obj.list = function(cbData){
 | 
					    obj.list = function(cbData){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        var output = '';
 | 
					        var output = '';
 | 
				
			||||||
        sysExec('lxc-ls --fancy', function(data){output+=data}, function(error){
 | 
					        sysExec('lxc-ls --fancy', function(data){
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            output = output.split("\n");
 | 
					            output = output.split("\n");
 | 
				
			||||||
            var keys = output.splice(0,1)[0].split(/\s+/).slice(0,-1);
 | 
					            var keys = output.splice(0,1)[0].split(/\s+/).slice(0,-1);
 | 
				
			||||||
 | 
				
			|||||||
@ -17,6 +17,7 @@
 | 
				
			|||||||
    "redis": "~2.4.2",
 | 
					    "redis": "~2.4.2",
 | 
				
			||||||
    "child": "0.0.3",
 | 
					    "child": "0.0.3",
 | 
				
			||||||
    "colors": "~1.1.2",
 | 
					    "colors": "~1.1.2",
 | 
				
			||||||
    "async": "~1.5.2"
 | 
					    "async": "~1.5.2",
 | 
				
			||||||
 | 
					    "node-cmd": "~1.1.1"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user