Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes new drive structure on ephemeral drives #49

Merged
merged 4 commits into from
Sep 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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|
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node[cloud] most likely should be node['cloud']

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cloud is a variable:

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