~mfoord/juju-core/tests-replset

« back to all changes in this revision

Viewing changes to state/state.go

  • Committer: Benji York
  • Date: 2013-03-15 15:20:42 UTC
  • mfrom: (993.3.9 1130151)
  • Revision ID: benji.york@canonical.com-20130315152042-kn87kj7tqtkqozuq
Add ServiceDestroyUnits to the API

R=fwereade, dimitern, rog
CC=
https://codereview.appspot.com/7554046

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
        return nil
58
58
}
59
59
 
 
60
const serviceSnippet = "[a-z][a-z0-9]*(-[a-z0-9]*[a-z][a-z0-9]*)*"
 
61
 
60
62
var (
61
 
        validService = regexp.MustCompile("^[a-z][a-z0-9]*(-[a-z0-9]*[a-z][a-z0-9]*)*$")
62
 
        validUnit    = regexp.MustCompile("^[a-z][a-z0-9]*(-[a-z0-9]*[a-z][a-z0-9]*)*/[0-9]+$")
 
63
        validService = regexp.MustCompile("^" + serviceSnippet + "$")
 
64
        validUnit    = regexp.MustCompile("^" + serviceSnippet + "(-[a-z0-9]*[a-z][a-z0-9]*)*/[0-9]+$")
63
65
        validMachine = regexp.MustCompile("^0$|^[1-9][0-9]*$")
64
66
)
65
67