Merge lp:~thumper/juju-core/juju-mongodb into lp:~go-bot/juju-core/trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Tim Penhey | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 2441 | ||||
Proposed branch: | lp:~thumper/juju-core/juju-mongodb | ||||
Merge into: | lp:~go-bot/juju-core/trunk | ||||
Diff against target: |
243 lines (+104/-27) 4 files modified
agent/mongo/mongo.go (+30/-3) agent/mongo/mongo_test.go (+2/-1) environs/cloudinit/cloudinit.go (+24/-17) environs/cloudinit/cloudinit_test.go (+48/-6) |
||||
To merge this branch: | bzr merge lp:~thumper/juju-core/juju-mongodb | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+211642@code.launchpad.net |
Commit message
Use juju-mongodb on trusty.
This branch does the simplest thing that can work.
For trusty, juju-mongodb is always used, for other
series mongodb-server is used.
This does mean that the local provider on trusty will
now depend on juju-mongodb. James Page is aware, and
will make the dependency required for the juju-local
package when we tell him.
Tested on the local provider on trusty, and ec2 using
precise.
Description of the change
Use juju-mongodb on trusty.
This branch does the simplest thing that can work.
For trusty, juju-mongodb is always used, for other
series mongodb-server is used.
This does mean that the local provider on trusty will
now depend on juju-mongodb. James Page is aware, and
will make the dependency required for the juju-local
package when we tell him.
Tested on the local provider on trusty, and ec2 using
precise.
Reviewers: mp+211642_ code.launchpad. net,
Message:
Please take a look.
Description:
Use juju-mongodb on trusty.
This branch does the simplest thing that can work.
For trusty, juju-mongodb is always used, for other
series mongodb-server is used.
This does mean that the local provider on trusty will
now depend on juju-mongodb. James Page is aware, and
will make the dependency required for the juju-local
package when we tell him.
Tested on the local provider on trusty, and ec2 using
precise.
https:/ /code.launchpad .net/~thumper/ juju-core/ juju-mongodb/ +merge/ 211642
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/77300044/
Affected files (+56, -26 lines): mongo.go mongo_test. go cloudinit/ cloudinit. go cloudinit/ cloudinit_ test.go
A [revision details]
M agent/mongo/
M agent/mongo/
M environs/
M environs/
Index: [revision details] 20140318032657- od048h1fmr1ocrf d
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: agent/mongo/ mongo.go mongo/mongo. go' mongo.go 2014-03-07 16:08:14 +0000 mongo.go 2014-03-18 22:21:00 +0000
=== modified file 'agent/
--- agent/mongo/
+++ agent/mongo/
@@ -25,8 +25,28 @@
// JujuMongodPath holds the default path to the juju-specific mongod. juju/bin/ mongod"
JujuMongodPath = "/usr/lib/
+ // MongodbServerPath holds the default path to the generic mongod.
+ MongodbServerPath = "/usr/bin/mongod"
)
+// MongoPackageFor Series returns the name of the mongo package for the Series( series string) string { ries(series string) string { er(dir string, port int) error { (mongoScriptVer sion) vice(name, dir, port) ries("some- series" ) vice(name, mongodPath, dir, port) vi...
series
+// of the machine that it is going to be running on.
+func MongoPackageFor
+ if series == "trusty" {
+ return "juju-mongodb"
+ }
+ return "mongodb-server"
+}
+
+// MongodPathForSeries returns the path to the mongod executable for the
+// series of the machine that it is going to be running on.
+func MongodPathForSe
+ if series == "trusty" {
+ return JujuMongodPath
+ }
+ return MongodbServerPath
+}
+
// MongoPath returns the executable path to be used to run mongod on this
// machine. If the juju-bundled version of mongo exists, it will return
that
// path, otherwise it will return the command to run mongod from the path.
@@ -48,8 +68,12 @@
// This method will remove old versions of the mongo upstart script as
necessary
// before installing the new version.
func EnsureMongoServ
+ // NOTE: ensure that the right package is installed?
name := makeServiceName
- service, err := MongoUpstartSer
+ // TODO: get the series from somewhere, non trusty values return
+ // the existing default path.
+ mongodPath := MongodPathForSe
+ service, err := MongoUpstartSer
if err != nil {
return err
}
@@ -132,7 +156,7 @@
// MongoUpstartService returns the upstart config for the mongo state
service.
//
// This method assumes there is a server.pem keyfile in dataDir.
-func MongoUpstartSer