       response.on "end", () ->
         console.log "file download complete", response.statusCode
         if response.statusCode is 200
-          console.log "chdirpath", kitePath
-          process.chdir kitePath
-          
-          cmd = spawn "unzip", ["#{name}.zip"]
-
+          cmd = spawn "unzip", [ path.join(@kitesPath, "#{kiteName}.zip"), "-d", @kitesPath]
           console.log 'unziping kite'
           
           cmd.stdout.on 'data', (data) ->

fs       = require 'fs-extra'
path     = require 'path'

class LXC
  
  constructor: (@name) ->
    @pathToContainers = "/var/lib/lxc"
    console.log "......LXC constructor",  @name

  createLxc: (callback) ->
    cmd = spawn "create-lxc", [@name]
    console.log 'create lxc'
    cmd.stdout.on 'data', (data) ->
      console.log 'stdout: ', data.toString()

    cmd.on 'close', (code) ->
      console.log 'lxc-execute process exited with code ', code

kite.worker manifest, 
  # This is a dummy method of the kite.
  deploy: (options, callback) ->
    {id, kiteName, zipUrl} = options
    deployment = new Deployment(id, kiteName, zipUrl)
    deployment.create-lxc () ->
      deployment.downloadAndExtractKite deployment.runKite.bind deployment

    return callback null, "Hello, I'm #{name}! This is Deployer"
