~juju-qa/ubuntu/xenial/juju/2.0-rc2

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/environs/cloudspec.go

  • Committer: Nicholas Skaggs
  • Date: 2016-09-30 14:39:30 UTC
  • mfrom: (1.8.1)
  • Revision ID: nicholas.skaggs@canonical.com-20160930143930-vwwhrefh6ftckccy
import upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
        // Region is the name of the cloud region.
86
86
        Region string
87
87
}
 
88
 
 
89
// NewRegionSpec returns a RegionSpec ensuring neither arg is empty.
 
90
func NewRegionSpec(cloud, region string) (*RegionSpec, error) {
 
91
        if cloud == "" || region == "" {
 
92
                return nil, errors.New("cloud and region are required to be non empty strings")
 
93
        }
 
94
        return &RegionSpec{Cloud: cloud, Region: region}, nil
 
95
}