~go-bot/gwacl/test

« back to all changes in this revision

Viewing changes to example/management/run.go

  • Committer: Tarmac
  • Author(s): Gavin Panella
  • Date: 2013-07-26 12:21:22 UTC
  • mfrom: (201.1.3 remove-role-endpoints-2)
  • Revision ID: tarmac-20130726122122-8sldzautynf3ywdb
[r=julian-edwards][bug=][author=allenap] Niceties missed from the main remove-role-endpoints branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
    api, err := gwacl.NewManagementAPI(subscriptionID, certFile)
77
77
    checkError(err)
78
78
 
79
 
    // Exercise the API.
80
 
 
81
 
    // Exercise hosted services API.
82
79
    ExerciseHostedServicesAPI(api)
83
80
 
84
81
    Info("All done.")
172
169
        deployments, err := api.ListAllDeployments(&gwacl.ListAllDeploymentsRequest{ServiceName: hostedService.ServiceName})
173
170
        checkError(err)
174
171
        if len(deployments) != len(detailedHostedService.Deployments) {
175
 
            Infof(
 
172
            Errorf(
176
173
                "Mismatch in reported deployments: %d != %d",
177
174
                len(deployments), len(detailedHostedService.Deployments))
178
175
        }
260
257
 
261
258
    defer func() {
262
259
        Info("Removing role input endpoint...")
263
 
        // FIXME: Something above - AddRoleEndpoints seems a prime suspect -
264
 
        // causes Azure to do something asynchronously, which we must wait for
265
 
        // before attempting this call, or it will blow up with a 409.
266
260
        err := api.RemoveRoleEndpoints(&gwacl.RemoveRoleEndpointsRequest{
267
261
            ServiceName:    hostServiceName,
268
262
            DeploymentName: deployment.Name,
275
269
 
276
270
    if pause {
277
271
        var wait string
278
 
        Info("Pausing so you can play with the newly-created VM")
279
 
        Info("To clear up, type something and press enter to continue")
 
272
        fmt.Println("Pausing so you can play with the newly-created VM")
 
273
        fmt.Println("To clear up, type something and press enter to continue")
280
274
        fmt.Scan(&wait)
281
275
    }
282
276
}