~axwalk/juju-core/trunk

« back to all changes in this revision

Viewing changes to worker/upgrader/upgrader.go

  • Committer: Tarmac
  • Author(s): Dimiter Naydenov
  • Date: 2013-07-30 18:39:16 UTC
  • mfrom: (1548.3.8 081-common-names)
  • Revision ID: tarmac-20130730183916-t2lui5ndotkzqrth
[r=dimitern] names: New package

This introduces a new juju-core/names pacakge,
which contains all name and tag related functions
shared between state and API: IsUnitName, UnitTag,
UnitNameFromTag, MachineTag, MachineIdFromTag,
IsServiceName, etc.

Because of the pacakge name, some functions were
renamed: names.IsUnit, IsService, UnitFromTag,
all refer to names.

In addition, a change was made to these two
functions: UnitNameFromTag and MachineIdFromTag.
Both of them now return (string, error), rather
than just string. The error return is used in
case the passed tag string has an invalid format.
Because of this change, some places needed slight
refactoring, otherwise no other changes where made.

https://codereview.appspot.com/12034043/

R=fwereade, rogpeppe

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
// retryAfter returns a channel that receives a value
21
21
// when a failed download should be retried.
22
 
// It is a function
23
22
var retryAfter = func() <-chan time.Time {
24
23
        return time.After(5 * time.Second)
25
24
}