Added ability to check for datadisks

Added `pry-coolline` to help with debugging in development

Signed-off-by: Russell Seymour <russell.seymour@turtlesystems.co.uk>
This commit is contained in:
Russell Seymour 2017-02-08 12:46:59 +00:00
parent 002aa73e7d
commit 082e5c0041
2 changed files with 11 additions and 0 deletions

View file

@ -9,6 +9,7 @@ group :development do
gem 'rake' gem 'rake'
gem 'rubocop' gem 'rubocop'
gem 'github_changelog_generator' gem 'github_changelog_generator'
gem 'pry-coolline'
end end
group :inspec do group :inspec do

View file

@ -52,6 +52,16 @@ class AzureVmImage < Inspec.resource(1)
end end
end end
def has_data_disks?
vm = get_vm(@opts[:host], @opts[:resource_group])
if vm.instance_of?(String)
vm
else
vm.storage_profile.data_disks.length > 0
end
end
# Retrieve the named virtual machine from Azure # Retrieve the named virtual machine from Azure
def get_vm(name, rg_name) def get_vm(name, rg_name)
# Azure connection # Azure connection