~axwalk/juju-core/trunk

Viewing all changes in revision 1565.

  • 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

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: