~fwereade/pyjuju/go-log-type

« back to all changes in this revision

Viewing changes to juju/conn.go

  • Committer: William Reade
  • Author(s): William Reade
  • Date: 2012-02-17 09:22:47 UTC
  • mfrom: (61.1.1 go)
  • Revision ID: fwereade@gmail.com-20120217092247-bs9zhqak1w3uzkzr
add jujud command (with subcommands initzk, unit, machine, provisioning)

Moved some of cmd/juju into cmd, with some changes, for reuse by cmd/jujud;
added subcommands listed above. None of these commands actually do anything
yet; I'm waiting for the State connection work to stabilise a bit before I
hook this up.

It's interesting to note that SuperCommand (once JujuCommand) needs only a
little work before it can itself usefully Register further SuperCommands, but
there's no call for that at the moment (we'd need to add a managesLogging
field which, if unset, would block initOutput and prevent InitFlagSet from
trying to extend the subcommand, and set it only on the top-level command).

The various agent types now implement cmd.Command by embedding agentConf;
and, indeed, it's even nicer like this :).

R=rog, niemeyer
CC=
https://codereview.appspot.com/5642048

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
import (
4
4
        "fmt"
5
5
        "launchpad.net/juju/go/environs"
 
6
        "regexp"
 
7
)
 
8
 
 
9
var (
 
10
        ValidService = regexp.MustCompile("^[a-z][a-z0-9]*(-[a-z0-9]*[a-z][a-z0-9]*)*$")
 
11
        ValidUnit    = regexp.MustCompile("^[a-z][a-z0-9]*(-[a-z0-9]*[a-z][a-z0-9]*)*/[0-9]+$")
6
12
)
7
13
 
8
14
// Conn holds a connection to a juju.