~themue/juju-core/053-env-more-script-friendly

« back to all changes in this revision

Viewing changes to state/watcher.go

  • Committer: Dimiter Naydenov
  • Date: 2013-07-29 15:15:41 UTC
  • mto: This revision was merged to the branch mainline in revision 1565.
  • Revision ID: dimiter.naydenov@canonical.com-20130729151541-zm8murwo9u7mtsdu
names: new package

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
        "launchpad.net/juju-core/environs/config"
17
17
        "launchpad.net/juju-core/errors"
18
18
        "launchpad.net/juju-core/instance"
 
19
        "launchpad.net/juju-core/names"
19
20
        "launchpad.net/juju-core/state/watcher"
20
21
        "launchpad.net/juju-core/utils/set"
21
22
)
158
159
// lifecycles of containers on a machine.
159
160
func (m *Machine) WatchContainers(ctype instance.ContainerType) StringsWatcher {
160
161
        members := D{{"parent", m.doc.Id}}
161
 
        match := fmt.Sprintf("^%s/%s/%s$", m.doc.Id, ctype, numberSnippet)
 
162
        match := fmt.Sprintf("^%s/%s/%s$", m.doc.Id, ctype, names.NumberSnippet)
162
163
        child := regexp.MustCompile(match)
163
164
        filter := func(key interface{}) bool {
164
165
                return child.MatchString(key.(string))