Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

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

* fix check for block-project-ssh-keys

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Jun 19, 2020
1 parent 59d32bb commit 6300d63
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libraries/google_compute_instance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,19 +203,19 @@ def service_account_scopes
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 6300d63

Please sign in to comment.