~fwereade/pyjuju/go-deploy-cmd-parsing

« back to all changes in this revision

Viewing changes to environs/ec2/image.go

environs/ec2: use current series and architecture for default instance constraint.

This also required adding an HVM check because amazon
doesn't like HVM images.

R=niemeyer
CC=
https://codereview.appspot.com/6249049

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
import (
4
4
        "bufio"
5
5
        "fmt"
 
6
        "launchpad.net/juju/go/environs"
6
7
        "net/http"
7
8
        "strings"
8
9
)
19
20
}
20
21
 
21
22
var defaultInstanceConstraint = &instanceConstraint{
22
 
        series:            "oneiric",
23
 
        arch:              "i386",
 
23
        series:            environs.CurrentSeries,
 
24
        arch:              environs.CurrentArch,
24
25
        persistentStorage: true,
25
26
        region:            "us-east-1",
26
27
        daily:             false,
49
50
        colArch
50
51
        colRegion
51
52
        colImageId
 
53
        _
 
54
        _
 
55
        colVtype
52
56
        colMax
53
57
        // + more that we don't care about.
54
58
)
82
86
                if len(f) < colMax {
83
87
                        continue
84
88
                }
 
89
                if f[colVtype] == "hvm" {
 
90
                        continue
 
91
                }
85
92
                if f[colEBS] != ebsMatch {
86
93
                        continue
87
94
                }