Skip to content

Commit

Permalink
Include catching ctrl-C
Browse files Browse the repository at this point in the history
  • Loading branch information
JackUrb committed Jun 27, 2023
1 parent 4f72d05 commit 13ad2af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mephisto/abstractions/architects/ec2/ec2_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ def deploy_fallback_server(
env=dict(os.environ, SSH_AUTH_SOCK=""),
)
detete_instance_address(session, allocation_id, association_id)
except Exception as e:
except (Exception, KeyboardInterrupt) as e:
old_handler = signal.signal(signal.SIGINT, cant_cancel_shutdown)
detete_instance_address(session, allocation_id, association_id)
signal.signal(signal.SIGINT, old_handler)
Expand Down Expand Up @@ -1020,7 +1020,7 @@ def deploy_to_routing_server(
)
detete_instance_address(session, allocation_id, association_id)
print("Server setup complete!")
except Exception as e:
except (Exception, KeyboardInterrupt) as e:
old_handler = signal.signal(signal.SIGINT, cant_cancel_shutdown)
detete_instance_address(session, allocation_id, association_id)
signal.signal(signal.SIGINT, old_handler)
Expand Down

0 comments on commit 13ad2af

Please sign in to comment.