LEFT | RIGHT |
1 // Copyright 2013 Canonical Ltd. | 1 // Copyright 2013 Canonical Ltd. |
2 // Licensed under the AGPLv3, see LICENCE file for details. | 2 // Licensed under the AGPLv3, see LICENCE file for details. |
3 | 3 |
4 package local | 4 package local |
5 | 5 |
6 import ( | 6 import ( |
7 "errors" | 7 "errors" |
8 "fmt" | 8 "fmt" |
9 "os/exec" | 9 "os/exec" |
10 "regexp" | 10 "regexp" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 switch containerType { | 76 switch containerType { |
77 case instance.LXC: | 77 case instance.LXC: |
78 return verifyLxc() | 78 return verifyLxc() |
79 case instance.KVM: | 79 case instance.KVM: |
80 return kvm.VerifyKVMEnabled() | 80 return kvm.VerifyKVMEnabled() |
81 } | 81 } |
82 return fmt.Errorf("Unknown container type specified in the config.") | 82 return fmt.Errorf("Unknown container type specified in the config.") |
83 } | 83 } |
84 | 84 |
85 func verifyMongod() error { | 85 func verifyMongod() error { |
86 » path := mongo.MongodPath() | 86 » path, err := mongo.MongodPath() |
| 87 » if err != nil { |
| 88 » » return err |
| 89 » } |
87 | 90 |
88 ver, err := mongodVersion(path) | 91 ver, err := mongodVersion(path) |
89 if err != nil { | 92 if err != nil { |
90 return err | 93 return err |
91 } | 94 } |
92 if ver.Compare(lowestMongoVersion) < 0 { | 95 if ver.Compare(lowestMongoVersion) < 0 { |
93 return fmt.Errorf("installed version of mongod (%v) is not suppo
rted by Juju. "+ | 96 return fmt.Errorf("installed version of mongod (%v) is not suppo
rted by Juju. "+ |
94 "Juju requires version %v or greater.", | 97 "Juju requires version %v or greater.", |
95 ver, | 98 ver, |
96 lowestMongoVersion) | 99 lowestMongoVersion) |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 } | 140 } |
138 return fmt.Errorf("%v\n%s", err, installMongodGeneric) | 141 return fmt.Errorf("%v\n%s", err, installMongodGeneric) |
139 } | 142 } |
140 | 143 |
141 func wrapLxcNotFound(err error) error { | 144 func wrapLxcNotFound(err error) error { |
142 if utils.IsUbuntu() { | 145 if utils.IsUbuntu() { |
143 return fmt.Errorf("%v\n%s", err, installLxcUbuntu) | 146 return fmt.Errorf("%v\n%s", err, installLxcUbuntu) |
144 } | 147 } |
145 return fmt.Errorf("%v\n%s", err, installLxcGeneric) | 148 return fmt.Errorf("%v\n%s", err, installLxcGeneric) |
146 } | 149 } |
LEFT | RIGHT |