Skip to content

Commit

Permalink
try fix2
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Grifalconi committed Sep 30, 2020
1 parent 8ea29ad commit 28b853f
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/publiccloud/provider.pm
Expand Up @@ -12,7 +12,7 @@
# Maintainer: Clemens Famulla-Conrad <cfamullaconrad@suse.de>

package publiccloud::provider;
use testapi;
use testapi qw(is_serial_terminal :DEFAULT);
use Mojo::Base -base;
use publiccloud::instance;
use Data::Dumper;
Expand Down Expand Up @@ -379,7 +379,12 @@ sub terraform_apply {
assert_script_run($cmd, $terraform_timeout);
my $ret = script_run('terraform apply -no-color -input=false myplan', $terraform_timeout);
unless (defined $ret) {
type_string("\cC"); # Send QUIT signal
if (is_serial_terminal()) {
type_string(qq(\c\\)); # Send QUIT signal
}
else {
send_key('ctrl-\\'); # Send QUIT signal
}
assert_script_run('true'); # make sure we have a prompt
record_info('ERROR', 'Terraform apply failed with timeout', result => 'fail');
assert_script_run('cd ' . TERRAFORM_DIR);
Expand Down Expand Up @@ -437,7 +442,12 @@ sub terraform_destroy {
}
my $ret = script_run('terraform destroy -no-color -auto-approve', get_var('TERRAFORM_TIMEOUT', TERRAFORM_TIMEOUT));
unless (defined $ret) {
type_string(qq(\c\\)); # Send QUIT signal
if (is_serial_terminal()) {
type_string(qq(\c\\)); # Send QUIT signal
}
else {
send_key('ctrl-\\'); # Send QUIT signal
}
assert_script_run('true'); # make sure we have a prompt
record_info('ERROR', 'Terraform destroy failed with timeout', result => 'fail');
assert_script_run('cd ' . TERRAFORM_DIR);
Expand Down

0 comments on commit 28b853f

Please sign in to comment.