Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #299 from cloudfoundry/get-null-locationGroupId
Browse files Browse the repository at this point in the history
Retrieve standard prices from a package.
  • Loading branch information
edwardstudy authored Nov 19, 2018
2 parents 76f32de + 1b7904c commit 54ba4f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/bosh-softlayer-cpi/softlayer/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -779,9 +779,12 @@ func (c *ClientManager) UpgradeInstance(id int, cpu int, memory int, network int
return 0, bosherr.Errorf("No package found for type: %s", packageType)
}
packageID := *productPackages[0].Id
filters := filter.Path("items.prices.locationGroupId").IsNull().Build()

packageItems, err := c.PackageService.
Id(packageID).
Mask("keyName, description, capacity, prices[id, locationGroupId, categories[categoryCode]]").
Filter(filters).
GetItems()
if err != nil {
return 0, err
Expand Down Expand Up @@ -1621,7 +1624,7 @@ func (c *ClientManager) AttachSecondDiskToInstance(id int, diskSize int) error {
var err error
until := time.Now().Add(time.Duration(1) * time.Hour)
if err = c.WaitInstanceHasNoneActiveTransaction(*sl.Int(id), until); err != nil {
return bosherr.WrapError(err, "Waiting until instance has none active transaction before os_reload")
return bosherr.WrapError(err, "Waiting until instance has none active transaction before attach ephemeral disk")
}

orderId, err := c.UpgradeInstance(id, 0, 0, 0, false, false, diskSize)
Expand All @@ -1646,7 +1649,7 @@ func (c *ClientManager) UpgradeInstanceConfig(id int, cpu int, memory int, netwo
var err error
until := time.Now().Add(time.Duration(1) * time.Hour)
if err = c.WaitInstanceHasNoneActiveTransaction(*sl.Int(id), until); err != nil {
return bosherr.WrapError(err, "Waiting until instance has none active transaction before os_reload")
return bosherr.WrapError(err, "Waiting until instance has none active transaction before upgrade instance")
}

orderId, err := c.UpgradeInstance(id, cpu, memory, network, privateCPU, dedicatedHost, 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2275,7 +2275,7 @@ var _ = Describe("InstanceHandler", func() {

err := cli.AttachSecondDiskToInstance(vgID, 300)
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("Waiting until instance has none active transaction before os_reload"))
Expect(err.Error()).To(ContainSubstring("Waiting until instance has none active transaction before attach ephemeral disk"))
})

It("Return error when call UpgradeInstance return an error", func() {
Expand Down Expand Up @@ -2482,7 +2482,7 @@ var _ = Describe("InstanceHandler", func() {

err := cli.UpgradeInstanceConfig(vgID, 2, 0, 0, false, false)
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("Waiting until instance has none active transaction before os_reload"))
Expect(err.Error()).To(ContainSubstring("Waiting until instance has none active transaction before upgrade instance"))
})

It("Return error when call UpgradeInstance return error", func() {
Expand Down

0 comments on commit 54ba4f7

Please sign in to comment.