~ubuntu-branches/ubuntu/trusty/juju-core/trusty-proposed

« back to all changes in this revision

Viewing changes to src/launchpad.net/juju-core/state/apiserver/testing/errors.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-01-29 11:40:20 UTC
  • mfrom: (23.1.1 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20140129114020-ejieitm8smtt5vln
Tags: 1.17.1-0ubuntu2
d/tests/local-provider: Don't fail tests if ~/.juju is present as its
created by the juju version command. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
package testing
5
5
 
6
6
import (
 
7
        "fmt"
 
8
 
7
9
        "launchpad.net/juju-core/state/api/params"
8
10
)
9
11
 
14
16
 
15
17
func NotFoundError(prefixMessage string) *params.Error {
16
18
        return &params.Error{
17
 
                Message: prefixMessage + " not found",
 
19
                Message: fmt.Sprintf("%s not found", prefixMessage),
18
20
                Code:    params.CodeNotFound,
19
21
        }
20
22
}
21
23
 
22
24
func NotProvisionedError(machineId string) *params.Error {
23
25
        return &params.Error{
24
 
                Message: "machine " + machineId + " is not provisioned",
 
26
                Message: fmt.Sprintf("machine %s is not provisioned", machineId),
25
27
                Code:    params.CodeNotProvisioned,
26
28
        }
27
29
}
28
30
 
 
31
func NotAssignedError(unitName string) *params.Error {
 
32
        return &params.Error{
 
33
                Message: fmt.Sprintf("unit %q is not assigned to a machine", unitName),
 
34
                Code:    params.CodeNotAssigned,
 
35
        }
 
36
}
 
37
 
29
38
func ServerError(message string) *params.Error {
30
39
        return &params.Error{
31
40
                Message: message,