Skip to content
Permalink
Browse files
Add a special use case for CreateServiceOffering
I tried to make this a more generic fix as it seems more API’s have
this pattern, but it seems CloudStack is just too inconsistent for this.

Fixes #44
  • Loading branch information
Sander van Harmelen committed Jan 29, 2016
1 parent fa516de commit fe4476b8268b949158dcf0512a6e80e39d38aa9c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
@@ -349,6 +349,10 @@ func (s *ServiceOfferingService) CreateServiceOffering(p *CreateServiceOfferingP
return nil, err
}

if resp, err = getRawValue(resp); err != nil {
return nil, err
}

var r CreateServiceOfferingResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
@@ -301,6 +301,10 @@ func (s *ServiceOfferingService) CreateServiceOffering(p *CreateServiceOfferingP
return nil, err
}

if resp, err = getRawValue(resp); err != nil {
return nil, err
}

var r CreateServiceOfferingResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
@@ -349,6 +349,10 @@ func (s *ServiceOfferingService) CreateServiceOffering(p *CreateServiceOfferingP
return nil, err
}

if resp, err = getRawValue(resp); err != nil {
return nil, err
}

var r CreateServiceOfferingResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
@@ -966,7 +966,7 @@ func (s *service) generateNewAPICallFunc(a *API) {
pn(" return nil, err")
pn(" }")
pn("")
if n == "CreateNetwork" || n == "CreateSSHKeyPair" || n == "RegisterSSHKeyPair" {
if n == "CreateNetwork" || n == "CreateServiceOffering" || n == "CreateSSHKeyPair" || n == "RegisterSSHKeyPair" {
pn(" if resp, err = getRawValue(resp); err != nil {")
pn(" return nil, err")
pn(" }")

0 comments on commit fe4476b

Please sign in to comment.