From 817f62050b4b096f6e6554eb53e226f6097b7278 Mon Sep 17 00:00:00 2001 From: Tommy Lacroix Date: Thu, 14 Mar 2019 10:17:59 -0400 Subject: [PATCH] Issue #185: Makes codedeploy-agent compatible with Ubuntu 18.04 when deploying two different apps in the base common directory. ie.: - `/var/www/some-api/` - `/var/www/some-angular-app/` This works fine on Ubuntu 16.04, but you get the following error on Ubuntu 18.04 with ruby 2.5: `Unknown error, Directory not empty @ dir_s_rmdir - /var/www` It might not be the best way to do it, but it is meant to provide a solution until this officially gets fixed since it has been open since August 2018 already. --- lib/instance_agent/plugins/codedeploy/install_instruction.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/instance_agent/plugins/codedeploy/install_instruction.rb b/lib/instance_agent/plugins/codedeploy/install_instruction.rb index b33cc81c..c6027918 100644 --- a/lib/instance_agent/plugins/codedeploy/install_instruction.rb +++ b/lib/instance_agent/plugins/codedeploy/install_instruction.rb @@ -212,7 +212,7 @@ def execute # TODO (AWSGLUE-713): handle the exception if the directory is non-empty; # this might mean the customer has put files in this directory and we should # probably ignore the error and move on - FileUtils.rmdir(@file_path) + FileUtils.rmdir(@file_path) rescue StandardError else FileUtils.rm(@file_path) end