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

Issue 10274044: Add a MachineIdFromTag function.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 10 months ago by thumper
Modified:
10 years, 10 months ago
Reviewers:
mp+169327, dave, jameinel, fwereade
Visibility:
Public.

Description

Add a MachineIdFromTag function. There are times (coming in future branches) where you want to be able to reverse the MachineTag result back into a machineId. https://code.launchpad.net/~thumper/juju-core/machine-id-from-tag/+merge/169327 Requires: https://code.launchpad.net/~thumper/juju-core/instance-instance/+merge/169325 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -1 line) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M state/machine.go View 1 chunk +12 lines, -1 line 1 comment Download
M state/machine_test.go View 1 chunk +9 lines, -0 lines 1 comment Download

Messages

Total messages: 4
thumper
Please take a look.
10 years, 10 months ago (2013-06-14 02:30:00 UTC) #1
fwereade
LGTM
10 years, 10 months ago (2013-06-14 07:53:35 UTC) #2
jameinel
LGTM
10 years, 10 months ago (2013-06-16 08:36:41 UTC) #3
dave_cheney.net
10 years, 10 months ago (2013-06-17 06:45:37 UTC) #4
https://codereview.appspot.com/10274044/diff/1/state/machine.go
File state/machine.go (right):

https://codereview.appspot.com/10274044/diff/1/state/machine.go#newcode115
state/machine.go:115: tag := fmt.Sprintf("%s%s", machineTagPrefix, id)
for super cow powers you could do

const format = machineTagPrefix+"%s"
tag := fmt.Sprintf(format, id)

https://codereview.appspot.com/10274044/diff/1/state/machine_test.go
File state/machine_test.go (right):

https://codereview.appspot.com/10274044/diff/1/state/machine_test.go#newcode201
state/machine_test.go:201:
c.Assert(state.MachineIdFromTag(state.MachineTag(nested)), Equals, nested)
can we have some tests for dodgy machine tags please.
Sign in to reply to this message.

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