From 6300d63cb056106125aec919824400bb77a74699 Mon Sep 17 00:00:00 2001 From: The Magician Date: Fri, 19 Jun 2020 14:21:09 -0700 Subject: [PATCH] Fix check for serial port disabled (#3695) (#415) * Fix check for serial port disabled * fix check for block-project-ssh-keys Signed-off-by: Modular Magician --- libraries/google_compute_instance.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/google_compute_instance.rb b/libraries/google_compute_instance.rb index 402678efe..eea847183 100644 --- a/libraries/google_compute_instance.rb +++ b/libraries/google_compute_instance.rb @@ -203,8 +203,8 @@ 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 @@ -212,10 +212,10 @@ def block_project_ssh_keys 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?