mirror of
https://github.com/inspec/inspec
synced 2024-11-27 23:20:33 +00:00
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:
parent
002aa73e7d
commit
082e5c0041
2 changed files with 11 additions and 0 deletions
1
Gemfile
1
Gemfile
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue