Merge lp:~jameinel/juju-core/log-mongo-version into lp:~go-bot/juju-core/trunk
Proposed by
John A Meinel
Status: | Merged |
---|---|
Approved by: | John A Meinel |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2646 |
Proposed branch: | lp:~jameinel/juju-core/log-mongo-version |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
164 lines (+36/-13) 4 files modified
agent/mongo/mongo.go (+21/-7) agent/mongo/mongo_test.go (+12/-3) provider/openstack/local_test.go (+2/-2) worker/provisioner/provisioner_task.go (+1/-1) |
To merge this branch: | bzr merge lp:~jameinel/juju-core/log-mongo-version |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+215656@code.launchpad.net |
Commit message
agent/mongo: log version of mongo
Just before we start mongo, log the version so we know what we're
running. This is mostly just to aid us in debugging log files from
other people.
Description of the change
agent/mongo: log version of mongo
Just before we start mongo, log the version so we know what we're
running. This is mostly just to aid us in debugging log files from
other people.
To post a comment you must log in.
Reviewers: mp+215656_ code.launchpad. net,
Message:
Please take a look.
Description:
agent/mongo: log version of mongo
Just before we start mongo, log the version so we know what we're
running. This is mostly just to aid us in debugging log files from
other people.
https:/ /code.launchpad .net/~jameinel/ juju-core/ log-mongo- version/ +merge/ 215656
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/87570043/
Affected files (+22, -0 lines): mongo.go mongo_test. go
A [revision details]
M agent/mongo/
M agent/mongo/
Index: [revision details] 20140414112125- eouvcipf4rmjrah n
=== 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-04-12 09:18:12 +0000 mongo.go 2014-04-14 12:39:38 +0000
=== modified file 'agent/
--- agent/mongo/
+++ agent/mongo/
@@ -251,6 +251,17 @@
return nil
}
+func logMongoVersion (mongopath string) { Debugf( "found mongod at: %s", mongopath) mongopath, "--version") put() Infof(" failed to read the output from %s --version", mongopath) Debugf( "mongod --version:\n%s", string(output)) (mongopath)
+ logger.
+ cmd := exec.Command(
+ output, err := cmd.CombinedOut
+ if err != nil {
+ logger.
+ return
+ }
+ logger.
+}
+
// mongoUpstartService returns the upstart config for the mongo state
service.
//
// This method assumes there exist "server.pem" and "shared_secret"
keyfiles in dataDir.
@@ -267,6 +278,7 @@
if err != nil {
return nil, err
}
+ logMongoVersion
conf := &upstart.Conf{
Service: *svc,
Index: agent/mongo/ mongo_test. go mongo/mongo_ test.go' mongo_test. go 2014-04-11 19:48:39 +0000 mongo_test. go 2014-04-14 12:39:38 +0000 er(dir, port, namespace) svc.Installed( ), jc.IsTrue)
=== modified file 'agent/
--- agent/mongo/
+++ agent/mongo/
@@ -119,6 +119,14 @@
err = EnsureMongoServ
c.Assert(err, gc.IsNil)
c.Assert(
+
+ // make sure that we log the version of mongodb as we get ready to
+ // start it
+ tlog := c.GetTestLog()
+ any := `(.|\n)*`
+ start := "^" + any
+ tail := any + "$"
+ c.Assert(tlog, gc.Matches, start+`mongod --version:\ndb version
v2\.\d+\.\d+`+tail)
}
func (s *MongoSuite) TestNoMongoDir(c *gc.C) {