Skip to content

Commit 3423274

Browse files
committed
Fixed a typo that prevented virtual servers from being able to capture images
Fixes #47
1 parent f7ee991 commit 3423274

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

CHANGELOG.textile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*2.2*
2-
* Added the ability to set a timout for network requests. The timeout is given when a client is created by passing the :timeout hash parameter when creating a client. The value of the parameter is an integer number of seconds.
2+
* Added the ability to set a timout for network requests. The timeout is given when a client is created by passing the :timeout hash parameter when creating a client. The value of the parameter is an integer number of seconds.
3+
* Fixed a bug in VirtualServer#capture_image
34

45
*2.1.1*
56
* Virtual server upgrades no longer raise exceptions

lib/softlayer/VirtualServer.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,15 @@ def upgrade_max_port_speed!(network_speed_in_Mbps)
143143
#
144144
# The image_notes should be a string and will be added to the image as notes.
145145
#
146-
def capture_image(image_name, include_attached_storage = false, image_notes = nil)
146+
def capture_image(image_name, include_attached_storage = false, image_notes = '')
147+
image_notes = '' if !image_notes
148+
147149
disk_filter = lambda { |disk| disk['device'] == '0' }
148-
disk_filter = lambda { |disk| disk['device'] == '1' } if include_attached_storage
150+
disk_filter = lambda { |disk| disk['device'] != '1' } if include_attached_storage
149151

150152
disks = self.blockDevices.select(&disk_filter)
151153

152-
self.service.createArchiveTransaction(image_name, disks, notes) if disks && !disks.empty?
154+
self.service.createArchiveTransaction(image_name, disks, image_notes) if disks && !disks.empty?
153155
end
154156

155157
##

0 commit comments

Comments
 (0)