Merge lp:~waigani/gomaasapi/faildeploy into lp:gomaasapi

Proposed by Jesse Meek
Status: Merged
Approved by: Ian Booth
Approved revision: 62
Merge reported by: Jesse Meek
Merged at revision: not available
Proposed branch: lp:~waigani/gomaasapi/faildeploy
Merge into: lp:gomaasapi
Diff against target: 66 lines (+30/-5)
2 files modified
enum.go (+26/-1)
testservice.go (+4/-4)
To merge this branch: bzr merge lp:~waigani/gomaasapi/faildeploy
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+260786@code.launchpad.net

Commit message

Add missing node statuses, required to fix bug #1376246. There will be a follow up branch in juju-core which will use this commit to fix the bug.

Description of the change

Add missing node statuses, required to fix bug #1376246. There will be a follow up branch in juju-core which will use this commit to fix the bug.

To post a comment you must log in.
Revision history for this message
Raphaël Badin (rvb) wrote :

Fwiw, the 'status' field doesn't include the new statuses (for backward compatibility). To have access to the full ranges of 'in progress' statuses, use the 'substatus' field (the 'substatus' field was included in revision 3319).

Example: here is what a 'Deploying' node would look like:

{
        "status": 6,
        [...]
        "substatus": 9,
}

Revision history for this message
Ian Booth (wallyworld) wrote :

So in juju we are using the "deployment_status" API on the node to get it's status, which we assume is a string like "Deployed" or "Failed Deployment".

Will that work? I think that API is only on later MAAS's. So if we get a not implemented error, we jut ignore it.

Revision history for this message
Raphaël Badin (rvb) wrote :

> So in juju we are using the "deployment_status" API on the node to get it's status,
> which we assume is a string like "Deployed" or "Failed Deployment".

> Will that work? I think that API is only on later MAAS's. So if we get a not implemented
> error, we jut ignore it.

Right, this endpoint returns "Deployed", "Deploying", "Failed deployment", "Not in deployment".
The endpoint was added in revision 2633.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'enum.go'
2--- enum.go 2013-10-14 22:25:01 +0000
3+++ enum.go 2015-06-02 02:45:01 +0000
4@@ -25,8 +25,33 @@
5 NodeStatusReserved = "5"
6
7 // The node is powering a service from a charm or is ready for use with a fresh Ubuntu install.
8- NodeStatusAllocated = "6"
9+ NodeStatusDeployed = "6"
10
11 // The node has been removed from service manually until an admin overrides the retirement.
12 NodeStatusRetired = "7"
13+
14+ // The node is broken: a step in the node lifecyle failed. More details
15+ // can be found in the node's event log.
16+ NodeStatusBroken = "8"
17+
18+ // The node is being installed.
19+ NodeStatusDeploying = "9"
20+
21+ // The node has been allocated to a user and is ready for deployment.
22+ NodeStatusAllocated = "10"
23+
24+ // The deployment of the node failed.
25+ NodeStatusFailedDeployment = "11"
26+
27+ // The node is powering down after a release request.
28+ NodeStatusReleasing = "12"
29+
30+ // The releasing of the node failed.
31+ NodeStatusFailedReleasing = "13"
32+
33+ // The node is erasing its disks.
34+ NodeStatusDiskErasing = "14"
35+
36+ // The node failed to erase its disks.
37+ NodeStatusFailedDiskErasing = "15"
38 )
39
40=== modified file 'testservice.go'
41--- testservice.go 2015-01-13 03:11:30 +0000
42+++ testservice.go 2015-06-02 02:45:01 +0000
43@@ -266,7 +266,7 @@
44 systemId := systemIdEntry.(string)
45 attrs[resourceURI] = getNodeURL(server.version, systemId)
46 if _, hasStatus := attrs["status"]; !hasStatus {
47- attrs["status"] = NodeStatusAllocated
48+ attrs["status"] = NodeStatusDeployed
49 }
50 obj := newJSONMAASObject(attrs, server.client)
51 server.nodes[systemId] = obj
52@@ -617,11 +617,11 @@
53 if err != nil {
54 continue
55 }
56- // The MAAS node model has changed somewhat since this test server was written.
57- // For now, assume allocated = deployed, which is fine for testing with.
58 switch field {
59- case NodeStatusAllocated:
60+ case NodeStatusDeployed:
61 nodeStatus[systemId] = "Deployed"
62+ case NodeStatusFailedDeployment:
63+ nodeStatus[systemId] = "Failed deployment"
64 default:
65 nodeStatus[systemId] = "Not in Deployment"
66 }

Subscribers

People subscribed via source and target branches

to all changes: