Skip to content

Commit

Permalink
fix error in juju bootstrap mock
Browse files Browse the repository at this point in the history
  • Loading branch information
davecheney committed Sep 3, 2014
1 parent 02a87b7 commit fa30425
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
17 changes: 10 additions & 7 deletions cmd/jujud/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,16 @@ func newEnsureServerParams(agentConfig agent.Config) (mongo.EnsureServerParams,
}

params := mongo.EnsureServerParams{
StatePort: si.StatePort,
Cert: si.Cert,
PrivateKey: si.PrivateKey,
SharedSecret: si.SharedSecret,
DataDir: agentConfig.DataDir(),
Namespace: agentConfig.Value(agent.Namespace),
OplogSize: oplogSize,
APIPort: si.APIPort,
StatePort: si.StatePort,
Cert: si.Cert,
PrivateKey: si.PrivateKey,
SharedSecret: si.SharedSecret,
SystemIdentity: si.SystemIdentity,

DataDir: agentConfig.DataDir(),
Namespace: agentConfig.Value(agent.Namespace),
OplogSize: oplogSize,
}
return params, nil
}
Expand Down
10 changes: 6 additions & 4 deletions cmd/jujud/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ func (f *fakeEnsure) fakeEnsureMongo(args mongo.EnsureServerParams) error {
f.ensureCount++
f.dataDir, f.namespace, f.oplogSize = args.DataDir, args.Namespace, args.OplogSize
f.info = params.StateServingInfo{
StatePort: args.StatePort,
Cert: args.Cert,
PrivateKey: args.PrivateKey,
SharedSecret: args.SharedSecret,
APIPort: args.APIPort,
StatePort: args.StatePort,
Cert: args.Cert,
PrivateKey: args.PrivateKey,
SharedSecret: args.SharedSecret,
SystemIdentity: args.SystemIdentity,
}
return f.err
}
Expand Down
6 changes: 6 additions & 0 deletions mongo/mongo.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ func RemoveService(namespace string) error {

// EnsureServerParams is a parameter struct for EnsureServer.
type EnsureServerParams struct {
// APIPort is the port to connect to the api server.
APIPort int

// StatePort is the port to connect to the mongo server.
StatePort int

Expand All @@ -151,6 +154,9 @@ type EnsureServerParams struct {
// SharedSecret is a secret shared between mongo servers.
SharedSecret string

// SystemIdentity is the identity of the system.
SystemIdentity string

// DataDir is the machine agent data directory.
DataDir string

Expand Down

0 comments on commit fa30425

Please sign in to comment.