github.com/arvindram03/terraform@v0.3.7-0.20150212015210-408f838db36d/builtin/providers/azure/config.go (about)

     1  package azure
     2  
     3  import (
     4  	"fmt"
     5  	"log"
     6  	"os"
     7  
     8  	azure "github.com/MSOpenTech/azure-sdk-for-go"
     9  )
    10  
    11  type Config struct {
    12  	PublishSettingsFile string
    13  }
    14  
    15  func (c *Config) loadAndValidate() error {
    16  	if _, err := os.Stat(c.PublishSettingsFile); os.IsNotExist(err) {
    17  		return fmt.Errorf(
    18  			"Error loading Azure Publish Settings file '%s': %s",
    19  			c.PublishSettingsFile,
    20  			err)
    21  	}
    22  
    23  	log.Printf("[INFO] Importing Azure Publish Settings file...")
    24  	err := azure.ImportPublishSettingsFile(c.PublishSettingsFile)
    25  	if err != nil {
    26  		return err
    27  	}
    28  
    29  	return nil
    30  }