Skip to content

Commit

Permalink
Merge pull request #49 from rightscale-cookbooks/attached-disk-is-null
Browse files Browse the repository at this point in the history
fixes new drive structure on ephemeral drives
  • Loading branch information
cdwilhelm authored Sep 19, 2016
2 parents 9fbcaca + 6a82462 commit 7b8df73
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ ephemeral_lvm Cookbook CHANGELOG

This file is used to list changes made in each version of the ephemeral_lvm cookbook.

v1.0.16
-------

- updated helper library to node['gce']['instance'] instead of node['gce']['attached_disks']

v1.0.15
-------

Expand Down
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ source 'https://rubygems.org'
gem 'berkshelf'
gem 'thor-foodcritic'
gem 'thor-scmversion'
gem 'rack', '= 1.6.4'
gem 'json', '~> 1.8', '>= 1.8.3'
gem 'buff-ignore', '~> 1.1.1'

group :integration do
gem 'test-kitchen', '~> 1.2.1'
Expand Down
9 changes: 8 additions & 1 deletion libraries/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,14 @@ def self.get_ephemeral_devices(cloud, node)
if disk['type'] == "EPHEMERAL" && disk['deviceName'].match(/^local-ssd-\d+$/)
"/dev/disk/by-id/google-#{disk["deviceName"]}"
end
end
end unless node[cloud]['attached_disks'].nil?

ephemeral_devices = node[cloud]['instance']['disks'].map do |disk|
if disk['type'] == "LOCAL-SSD" && disk['deviceName'].match(/^local-ssd-\d+$/)
"/dev/disk/by-id/google-#{disk["deviceName"]}"
end
end unless node[cloud]['instance'].nil?

# Removes nil elements from the ephemeral_devices array if any.
ephemeral_devices.compact!
else
Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
license 'Apache 2.0'
description 'Configures available ephemeral devices on a cloud server'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.0.15'
version '1.0.16'

supports 'ubuntu'
supports 'centos'
Expand Down

0 comments on commit 7b8df73

Please sign in to comment.