add buffer to read template into

This commit is contained in:
Megan Marsh 2018-01-16 12:09:42 -08:00 committed by Matthew Hooker
parent 0117f53721
commit 7d72870179
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1
1 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,7 @@
package classic
import (
"bytes"
"fmt"
"text/template"
@ -44,6 +45,7 @@ func (s *stepCreateIPReservation) Run(state multistep.StateBag) multistep.StepAc
ui.Say("Creating Instance...")
// generate launch plan definition for this instance
var buffer bytes.Buffer
err = instanceTemplate.Execute(&buffer, instanceOptions{
Username: config.Username,
IdentityDomain: config.IdentityDomain,
@ -55,10 +57,8 @@ func (s *stepCreateIPReservation) Run(state multistep.StateBag) multistep.StepAc
fmt.Printf("Error creating launch plan definition: %s", err)
return "", err
}
// command line call
// $ opc compute launch-plans add --request-body=./master-instance.json
// ...
// for API docs see
// https://docs.oracle.com/en/cloud/iaas/compute-iaas-cloud/stcsa/op-launchplan--post.html
instanceID, err := client.CreateInstance(publicKey)
if err != nil {
err = fmt.Errorf("Problem creating instance: %s", err)