Skip to content

Commit

Permalink
Fix check for serial port disabled (#3695)
Browse files Browse the repository at this point in the history
* Fix check for serial port disabled

* fix check for block-project-ssh-keys
  • Loading branch information
KonradSchieban authored Jun 19, 2020
1 parent 59b275a commit 37c26f5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions third_party/inspec/custom_functions/google_compute_instance.erb
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,19 @@ end
def block_project_ssh_keys
return false if !defined?(@metadata['items']) || @metadata['items'].nil?
@metadata['items'].each do |element|
return true if element.key=='block-project-ssh-keys' and element.value.casecmp('true').zero?
return true if element.key=='block-project-ssh-keys' and element.value=='1'
return true if element['key']=='block-project-ssh-keys' and element['value'].casecmp('true').zero?
return true if element['key']=='block-project-ssh-keys' and element['value']=='1'
end
false
end

def has_serial_port_disabled?
return false if !defined?(@metadata['items']) || @metadata['items'].nil?
@metadata['items'].each do |element|
return true if element.key=='serial-port-enable' and element.value.casecmp('false').zero?
return true if element.key=='serial-port-enable' and element.value=='0'
return false if element['key']=='serial-port-enable' and element['value'].casecmp('true').zero?
return false if element['key']=='serial-port-enable' and element['value']=='1'
end
false
true
end

def has_disks_encrypted_with_csek?
Expand Down

0 comments on commit 37c26f5

Please sign in to comment.