Adding rescue clause when reading file
@@ -2003,12 +2003,18 @@ class Djinn
# We reload our old IPs (if we find them) so we can check later if
# they changed and act accordingly.
+ begin
if File.exists?("#{APPSCALE_CONFIG_DIR}/my_private_ip")
@my_private_ip = HelperFunctions.read_file("#{APPSCALE_CONFIG_DIR}/my_private_ip").chomp
end
if File.exists?("#{APPSCALE_CONFIG_DIR}/my_public_ip")
@my_public_ip = HelperFunctions.read_file("#{APPSCALE_CONFIG_DIR}/my_public_ip").chomp
end
+ rescue Errno::ENOENT
+ Djinn.log_warn("my_public_ip or my_private_ip disapeared.")
+ @my_private_ip = nil
+ @my_public_ip = nil
+ end
# If we have the ZK_LOCATIONS_FILE, the deployment has already been
# configured and started. We need to check if we are a zookeeper host
