Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(634)

Issue 6585053: state: rename Unit.Name to Unit.Id

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 7 months ago by rog
Modified:
11 years, 7 months ago
Reviewers:
niemeyer, mp+127341
Visibility:
Public.

Description

state: rename Unit.Name to Unit.Id This is a preparatory step to renaming PathKey to Name. Also changed a couple of tests to use PathKey rather than Id. https://code.launchpad.net/~rogpeppe/juju-core/097-state-unit-id/+merge/127341 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : state: rename Unit.Name to Unit.Id #

Unified diffs Side-by-side diffs Delta from patch set Stats (+120 lines, -121 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/juju/deploy_test.go View 1 chunk +7 lines, -7 lines 0 comments Download
M cmd/juju/status.go View 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujuc/server/context.go View 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujuc/server/context_test.go View 3 chunks +5 lines, -5 lines 0 comments Download
M cmd/jujuc/server/juju-log.go View 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujuc/server/relation-get.go View 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujuc/server/util_test.go View 2 chunks +1 line, -3 lines 0 comments Download
M cmd/jujud/unit.go View 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujud/unit_test.go View 3 chunks +3 lines, -3 lines 0 comments Download
M container/container.go View 1 chunk +2 lines, -2 lines 0 comments Download
M state/assign_test.go View 1 chunk +1 line, -1 line 0 comments Download
M state/life_test.go View 1 chunk +1 line, -1 line 0 comments Download
M state/machine.go View 1 chunk +1 line, -1 line 0 comments Download
M state/machine_test.go View 2 chunks +9 lines, -9 lines 0 comments Download
M state/relation.go View 4 chunks +5 lines, -5 lines 0 comments Download
M state/relation_test.go View 3 chunks +2 lines, -3 lines 0 comments Download
M state/service.go View 4 chunks +6 lines, -6 lines 0 comments Download
M state/service_test.go View 7 chunks +11 lines, -10 lines 0 comments Download
M state/unit.go View 19 chunks +24 lines, -24 lines 0 comments Download
M state/unit_test.go View 6 chunks +6 lines, -6 lines 0 comments Download
M state/watcher.go View 5 chunks +8 lines, -8 lines 0 comments Download
M worker/firewaller/firewaller.go View 4 chunks +7 lines, -7 lines 0 comments Download
M worker/machiner/machiner.go View 2 chunks +2 lines, -2 lines 0 comments Download
M worker/machiner/machiner_test.go View 1 chunk +2 lines, -2 lines 0 comments Download
M worker/uniter/relationer_test.go View 6 chunks +8 lines, -9 lines 0 comments Download
M worker/uniter/uniter.go View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 2
rog
Please take a look.
11 years, 7 months ago (2012-10-01 17:57:25 UTC) #1
niemeyer
11 years, 7 months ago (2012-10-01 18:23:28 UTC) #2
I've reviewed about 80% of this with trivial comments only, and then when I got
to reviewing the service bits, I got deadlocked.

You wisely decided not to switch service.Name to mean "service-wordpress",
because that'd mean the service name, which is a sane concept, wouldn't be a
service name. That, in turn, means the unit Name means something totally unlike
the service Name, so we get unit.Name() => "unit-wordpress-0", but
service.Name() => "wordpress".

Also, there are public parts of the interface, such as the JUJU_UNIT_NAME
environment variable, that we can't change, so we're introducing gratuitous
inconsistencies that we can't avoid with our renaming.

I suggest dropping our idea of replacing what the Name methods mean, and instead
doing a simpler change that introduces a Key method that returns the equivalent
of PathKey today, and dropping PathKey:

machine.Key() => "machine-0"
unit.Key() => "unit-wordpress-0"
service.Key() => "service-wordpress"

We can also have PrincipalKey in state.Info.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b