 
   @create = permit 'create machines',
 
-    success: revive (client, options, callback)->
+    success: revive yes, (client, options, callback)->
 
       { provider, stack, label } = options
 

  engineyard   : require './engineyard'

checkCredential = (client, pubKey, callback)->

  console.log pubKey

  JCredential = require './credential'
  JCredential.fetchByPublicKey client, pubKey, (err, credential)->


  @createMachine = (options, callback)->

    { vendor, label, meta, group, user } = options

    users  = [{ id: user.getId(), sudo: yes, owner: yes }]
    groups = [{ id: group.getId() }]

    machine = new JMachine {
      vendor, users, groups, meta, label
    }

    machine.save (err)=>

      if err
        callback err
        return console.warn \
          "Failed to create Machine for ", {users, groups}

      callback null, machine
