Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1140)

Unified Diff: worker/provisioner/provisioner_task.go

Issue 97400043: Change StopInstances to take []instance.Id
Patch Set: Change StopInstances to take []instance.Id Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « worker/provisioner/lxc-broker_test.go ('k') | worker/provisioner/provisioner_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: worker/provisioner/provisioner_task.go
=== modified file 'worker/provisioner/provisioner_task.go'
--- worker/provisioner/provisioner_task.go 2014-05-08 06:58:42 +0000
+++ worker/provisioner/provisioner_task.go 2014-05-14 02:59:53 +0000
@@ -397,7 +397,11 @@
if len(instances) == 0 {
return nil
}
- if err := task.broker.StopInstances(instances); err != nil {
+ ids := make([]instance.Id, len(instances))
+ for i, inst := range instances {
+ ids[i] = inst.Id()
+ }
+ if err := task.broker.StopInstances(ids...); err != nil {
logger.Errorf("broker failed to stop instances: %v", err)
return err
}
@@ -484,7 +488,7 @@
}
// We need to stop the instance right away here, set error status and go on.
task.setErrorStatus("cannot register instance for machine %v: %v", machine, err)
- if err := task.broker.StopInstances([]instance.Instance{inst}); err != nil {
+ if err := task.broker.StopInstances(inst.Id()); err != nil {
// We cannot even stop the instance, log the error and quit.
logger.Errorf("cannot stop instance %q for machine %v: %v", inst.Id(), machine, err)
return err
« no previous file with comments | « worker/provisioner/lxc-broker_test.go ('k') | worker/provisioner/provisioner_test.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b