~juju-qa/ubuntu/xenial/juju/xenial-2.0-beta3

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/tools/lxdclient/config.go

  • Committer: Martin Packman
  • Date: 2016-03-30 19:31:08 UTC
  • mfrom: (1.1.41)
  • Revision ID: martin.packman@canonical.com-20160330193108-h9iz3ak334uk0z5r
Merge new upstream source 2.0~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
// Config contains the config values used for a connection to the LXD API.
13
13
type Config struct {
14
14
        // Namespace identifies the namespace to associate with containers
15
 
        // and other resources with which the client interacts. If may be
 
15
        // and other resources with which the client interacts. It may be
16
16
        // blank.
 
17
        // TODO(jam) This doesn't appear to do much at the moment.
17
18
        Namespace string
18
19
 
19
20
        // Remote identifies the remote server to which the client should
32
33
        if err != nil {
33
34
                return cfg, errors.Trace(err)
34
35
        }
35
 
 
36
36
        return cfg, nil
37
37
}
38
38
 
39
39
// Validate checks the client's fields for invalid values.
40
40
func (cfg Config) Validate() error {
41
41
        // TODO(ericsnow) Check cfg.Namespace (if provided)?
42
 
 
43
 
        // TODO(ericsnow) Check cfg.Dirname (if provided)?
44
 
 
45
 
        // TODO(ericsnow) Check cfg.Filename (if provided)?
46
 
 
47
42
        if err := cfg.Remote.Validate(); err != nil {
48
43
                return errors.Trace(err)
49
44
        }