Merge lp://staging/~michael.nelson/goose/test-instance-state into lp://staging/goose

Proposed by Michael Nelson
Status: Merged
Approved by: John A Meinel
Approved revision: 102
Merged at revision: 100
Proposed branch: lp://staging/~michael.nelson/goose/test-instance-state
Merge into: lp://staging/goose
Diff against target: 94 lines (+40/-15)
3 files modified
nova/nova.go (+15/-14)
testservices/novaservice/service.go (+1/-1)
testservices/novaservice/service_test.go (+24/-0)
To merge this branch: bzr merge lp://staging/~michael.nelson/goose/test-instance-state
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+180788@code.staging.launchpad.net

Commit message

Enable server status to be set via control point.

Description of the change

Enable server status to be set via control point.

I'm not sure if goose is used outside of juju-core. Within juju-core the addServer function isn't accessed via a control point in any tests.

This (or something similar) is needed to allow creating test servers within juju-core tests with a specified status [1]

[1] https://code.launchpad.net/~michael.nelson/juju-core/1208504-post-bootstrap-hp-no-instances-found-try2/+merge/179899

https://codereview.appspot.com/12897044/

To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :
Download full text (5.9 KiB)

Reviewers: mp+180788_code.launchpad.net,

Message:
Please take a look.

Description:
Enable server status to be set via control point.

I'm not sure if goose is used outside of juju-core. Within juju-core the
addServer function isn't accessed via a control point in any tests.

This (or something similar) is needed to allow creating test servers
within juju-core tests with a specified status [1]

[1]
https://code.launchpad.net/~michael.nelson/juju-core/1208504-post-bootstrap-hp-no-instances-found-try2/+merge/179899

https://code.launchpad.net/~michael.nelson/goose/test-instance-state/+merge/180788

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/12897044/

Affected files:
   A [revision details]
   M nova/nova.go
   M testservices/novaservice/service.go
   M testservices/novaservice/service_test.go

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-20130701072216-t1v2cjfevu6zt0lt
+New revision: <email address hidden>

Index: nova/nova.go
=== modified file 'nova/nova.go'
--- nova/nova.go 2013-06-22 11:39:35 +0000
+++ nova/nova.go 2013-08-19 06:31:40 +0000
@@ -26,20 +26,21 @@

  // Server status values.
  const (
- StatusActive = "ACTIVE" // The server is active.
- StatusBuild = "BUILD" // The server has not finished the
original build process.
- StatusDeleted = "DELETED" // The server is deleted.
- StatusError = "ERROR" // The server is in error.
- StatusHardReboot = "HARD_REBOOT" // The server is hard rebooting.
- StatusPassword = "PASSWORD" // The password is being reset on
the server.
- StatusReboot = "REBOOT" // The server is in a soft reboot
state.
- StatusRebuild = "REBUILD" // The server is currently being
rebuilt from an image.
- StatusRescue = "RESCUE" // The server is in rescue mode.
- StatusResize = "RESIZE" // Server is performing the
differential copy of data that changed during its initial copy.
- StatusShutoff = "SHUTOFF" // The virtual machine (VM) was
powered down by the user, but not through the OpenStack Compute API.
- StatusSuspended = "SUSPENDED" // The server is suspended, either
by request or necessity.
- StatusUnknown = "UNKNOWN" // The state of the server is
unknown. Contact your cloud provider.
- StatusVerifyResize = "VERIFY_RESIZE" // System is awaiting confirmation
that the server is operational after a move or resize.
+ StatusActive = "ACTIVE" // The server is active.
+ StatusBuild = "BUILD" // The server has not finished
the original build process.
+ StatusBuildSpawning = "BUILD(spawning)" // The HP server has not finished
the original build process but does have networking.
+ StatusDeleted = "DELETED" // The server is deleted.
+ StatusError = "ERROR" // The server is in error.
+ StatusHardReboot = "HARD_REBOOT" // The server is hard rebooti...

Read more...

Revision history for this message
Dimiter Naydenov (dimitern) wrote :

Very good! LGTM with a couple of trivial suggestions.

https://codereview.appspot.com/12897044/diff/1/nova/nova.go
File nova/nova.go (right):

https://codereview.appspot.com/12897044/diff/1/nova/nova.go#newcode31
nova/nova.go:31: StatusBuildSpawning = "BUILD(spawning)" // The HP
server has not finished the original build process but does have
networking.
// The server has not finished the original build process but networking
works (HP Cloud specific) ?

https://codereview.appspot.com/12897044/diff/1/testservices/novaservice/service_test.go
File testservices/novaservice/service_test.go (right):

https://codereview.appspot.com/12897044/diff/1/testservices/novaservice/service_test.go#newcode263
testservices/novaservice/service_test.go:263: sr, _ :=
s.service.server(server.Id)
s/sr/server/ ? and change := to =
I think server() already returns a nova.ServerDetail

https://codereview.appspot.com/12897044/

102. By Michael Nelson

Reword status comment and reuse var in test.

Revision history for this message
Michael Nelson (michael.nelson) wrote :

Please take a look.

https://codereview.appspot.com/12897044/diff/1/nova/nova.go
File nova/nova.go (right):

https://codereview.appspot.com/12897044/diff/1/nova/nova.go#newcode31
nova/nova.go:31: StatusBuildSpawning = "BUILD(spawning)" // The HP
server has not finished the original build process but does have
networking.
On 2013/08/19 07:41:18, dimitern wrote:
> // The server has not finished the original build process but
networking works
> (HP Cloud specific) ?

Done.

https://codereview.appspot.com/12897044/diff/1/testservices/novaservice/service_test.go
File testservices/novaservice/service_test.go (right):

https://codereview.appspot.com/12897044/diff/1/testservices/novaservice/service_test.go#newcode263
testservices/novaservice/service_test.go:263: sr, _ :=
s.service.server(server.Id)
On 2013/08/19 07:41:18, dimitern wrote:
> s/sr/server/ ? and change := to =
> I think server() already returns a nova.ServerDetail

It returns *nova.ServerDetail, so I updated the previous var to be a
pointer and re-used.

https://codereview.appspot.com/12897044/

Revision history for this message
John A Meinel (jameinel) wrote :

No problems changing 'addServer'.

LGTM

https://codereview.appspot.com/12897044/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches