Merge lp:~rogpeppe/juju-core/453-maas-instance-uuid into lp:~go-bot/juju-core/trunk
Proposed by
Roger Peppe
Status: | Merged |
---|---|
Approved by: | Roger Peppe |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1990 |
Proposed branch: | lp:~rogpeppe/juju-core/453-maas-instance-uuid |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
323 lines (+76/-57) 9 files modified
provider/maas/config.go (+12/-6) provider/maas/config_test.go (+23/-7) provider/maas/environ.go (+2/-2) provider/maas/environ_test.go (+2/-2) provider/maas/environprovider.go (+12/-15) provider/maas/environprovider_test.go (+11/-11) provider/maas/maas_test.go (+6/-6) provider/maas/storage.go (+2/-2) provider/maas/storage_test.go (+6/-6) |
To merge this branch: | bzr merge lp:~rogpeppe/juju-core/453-maas-instance-uuid |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+191367@code.launchpad.net |
Commit message
provider/maas: do not use environ-uuid
As pointed out by fwereade, it could be
confusing to have two things in the system
that both purport to be a uuid for the environ.
Also make the MAAS EnvironProvider
check that we're not changing the maas-agent-name.
Description of the change
provider/maas: do not use environ-uuid
As pointed out by fwereade, it could be
confusing to have two things in the system
that both purport to be a uuid for the environ.
Also make the MAAS EnvironProvider
check that we're not changing the maas-instance-uuid.
To post a comment you must log in.
Reviewers: mp+191367_ code.launchpad. net,
Message:
Please take a look.
Description:
provider/maas: do not use environ-uuid
As pointed out by fwereade, it could be
confusing to have two things in the system
that both purport to be a uuid for the environ.
Also make the MAAS EnvironProvider .Validate
check that we're not changing the maas-instance-uuid.
https:/ /code.launchpad .net/~rogpeppe/ juju-core/ 453-maas- instance- uuid/+merge/ 191367
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/14741045/
Affected files (+58, -37 lines): maas/config. go maas/config_ test.go maas/environpro vider.go maas/environpro vider_test. go maas/maas_ test.go maas/storage_ test.go
A [revision details]
M provider/
M provider/
M provider/
M provider/
M provider/
M provider/
Index: [revision details] 20131016061150- dqoy06taxa0edyw m
=== 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: provider/ maas/config. go maas/config. go' maas/config. go 2013-10-15 16:18:32 +0000 maas/config. go 2013-10-16 10:29:29 +0000 key:resource- token:resource- secret uuid": schema.String(), compatibility, environment-uuid is the empty string compatibility, maas-instance-uuid is the empty string uuid": "",
=== modified file 'provider/
--- provider/
+++ provider/
@@ -18,14 +18,14 @@
// maas-oauth is a colon-separated triplet of:
// consumer-
"maas-oauth": schema.String(),
- // environment-uuid is an optional UUID to group the machines
+ // maas-instance-uuid is an optional UUID to group the instances
// acquired from MAAS, to support multiple environments per MAAS user.
- "environment-uuid": schema.String(),
+ "maas-instance-
}
var configDefaults = schema.Defaults{
- // For backward-
+ // For backward-
// by default. However, new environments should all use a UUID.
- "environment-uuid": "",
+ "maas-instance-
}
type maasEnvironConfig struct {
@@ -42,7 +42,7 @@
}
func (cfg *maasEnvironConfig) maasEnvironment UUID() string { "environment- uuid"]. (string) ; ok { "maas-instance- uuid"]. (string) ; ok { UnknownAttrs( ) "maas-instance- uuid"] != oldAttrs[ "maas-instance- uuid"] { uuid") Config)
- if uuid, ok := cfg.attrs[
+ if uuid, ok := cfg.attrs[
return uuid
}
return ""
@@ -72,6 +72,12 @@
if err != nil {
return nil, err
}
+ if oldCfg != nil {
+ oldAttrs := oldCfg.
+ if validated[
+ return nil, fmt.Errorf("cannot change maas-instance-
+ }
+ }
envCfg := new(maasEnviron
envCfg.Config = cfg
envCfg.attrs = validated
Index: provider/ maas/config_ test.go maas/config_ test.go' maas/config_ test.go 2013-10-15 16:52:58 +0000 maas/config_ test.go 2013-10-16 10:42:01 +0000 map[string] interface{ }{
=== modified file 'provider/
--- provider/
+++ provider/
@@ -47,10 +47,10 @@
uuid, err := utils.NewUUID()
c.Assert(err, gc.IsNil)
ecfg, err := newConfig(
- "maas-server": server,
- "maas-oauth": oauth,
- "environment-uuid": uuid.String(),
- "future-key": future,
+ "maas-server": server,
+ "ma...