     { client, user, account } = data
     { group : groupSlug }     = client.context
 
+    _createCredential = (client, options, callback) ->
+      createCredential client, options, (err, data_) ->
+        expect(err).to.not.exist
+        callback data_
+
+
+    _createProvisioner = (client, options, callback) ->
+      createProvisioner client, options, (err, data_) ->
+        expect(err).to.not.exist
+        callback data_
+
+
     _createStackTemplate = (client, options, callback) ->
       createStackTemplate client, options, (err, template) ->
         expect(err).to.not.exist
         callback { template }
-
-
-    _createStackFromTemplate = (stackData, options, callback) ->
-      ComputeProvider.generateStackFromTemplate stackData, options, (err, { stack }) ->
-        expect(err?.message).to.not.exist
-        callback { stack }
 
 
     _createStack = (client, options, callback) ->


    models.forEach (model) ->

      switch model
        when 'StackTemplate'
          queue.push ->
            _createStackTemplate client, options, (data_) ->
              data = _.extend data, data_
              queue.next()

        when 'Stack'
          queue.push ->
            _createStack client, options, (data_) ->
              data = _.extend data, data_
              queue.next()

        when 'Provisioner'
          queue.push ->
            createProvisioner client, options, (err, data_) ->
              expect(err).to.not.exist
              data = _.extend data, data_
              queue.next()

    queue.push -> callback data


  withConvertedUser }    = require '../../index'
{ createProvisioner }    = require './provisionerhelper'
{ createStackTemplate }  = require './stacktemplatehelper'
{ createCredential }     = require './credentialhelper'

JGroup          = require '../../../../social/lib/social/models/group'
JProvisioner    = require '../../../../social/lib/social/models/computeproviders/provisioner'
