~gz/goose/novaservice_preserve_negative_ports

« back to all changes in this revision

Viewing changes to testservices/novaservice/service.go

  • Committer: Tarmac
  • Author(s): Ian Booth
  • Date: 2013-02-08 02:38:12 UTC
  • mfrom: (66.1.7 hpopenstack)
  • Revision ID: tarmac-20130208023812-llhkeo6vitwmf3co
[r=wallyworld] Add HP Cloud support

A few major changes here. HP Cloud sends many core data structures over the wire with int IDs rather than string.
It also lacks a security groups API but instead adds the groups to the server detail record.

To make everything work in the least invasive way, I added custom json (un)marshallers to the affected data structures. The affected
data structures are Entity, ServerDetail, FloatingIP, FlavorDetail. The approach allows the built in marshalling to be used for everything except
the IDs, which are converted from int or string as required.

The live tests are enhanced to allow them to be run against HP Cloud or Canonistack as required:
go test -gocheck.v -live -vendor canonistack
or
go test -gocheck.v -live -vendor hpcloud

The local tests are configured to run twice - once with nemric ids and one with string ids.

Show diffs side-by-side

added added

removed removed

Lines of Context:
230
230
        }
231
231
        return &nova.Entity{
232
232
                Id:    server.Id,
 
233
                UUID:  server.UUID,
233
234
                Name:  server.Name,
234
235
                Links: server.Links,
235
236
        }, nil
277
278
                if n.matchServer(filter, server) {
278
279
                        entities = append(entities, nova.Entity{
279
280
                                Id:    server.Id,
 
281
                                UUID:  server.UUID,
280
282
                                Name:  server.Name,
281
283
                                Links: server.Links,
282
284
                        })