|
8 | 8 | from . import build |
9 | 9 | from .. import exceptions |
10 | 10 | from ..util import parse_cloudformation_template |
11 | | -from ..status import NotSubmittedStatus, NotUpdatedStatus, COMPLETE |
| 11 | +from ..status import ( |
| 12 | + NotSubmittedStatus, |
| 13 | + NotUpdatedStatus, |
| 14 | + COMPLETE, |
| 15 | + INTERRUPTED, |
| 16 | +) |
12 | 17 |
|
13 | 18 | logger = logging.getLogger(__name__) |
14 | 19 |
|
@@ -198,16 +203,21 @@ def _print_new_stack(self, stack, parameters): |
198 | 203 |
|
199 | 204 | def _diff_stack(self, stack, **kwargs): |
200 | 205 | """Handles the diffing a stack in CloudFormation vs our config""" |
| 206 | + if self.cancel.wait(0): |
| 207 | + return INTERRUPTED |
| 208 | + |
201 | 209 | if not build.should_submit(stack): |
202 | 210 | return NotSubmittedStatus() |
203 | 211 |
|
204 | 212 | if not build.should_update(stack): |
205 | 213 | return NotUpdatedStatus() |
206 | 214 |
|
| 215 | + provider_stack = self.provider.get_stack(stack.fqn) |
| 216 | + |
207 | 217 | # get the current stack template & params from AWS |
208 | 218 | try: |
209 | 219 | [old_template, old_params] = self.provider.get_stack_info( |
210 | | - stack.fqn) |
| 220 | + provider_stack) |
211 | 221 | except exceptions.StackDoesNotExist: |
212 | 222 | old_template = None |
213 | 223 | old_params = {} |
@@ -241,6 +251,9 @@ def _diff_stack(self, stack, **kwargs): |
241 | 251 | ) |
242 | 252 | print_stack_changes(stack.name, new_stack, old_stack, new_params, |
243 | 253 | old_params) |
| 254 | + |
| 255 | + self.provider.set_outputs(stack.fqn, provider_stack) |
| 256 | + |
244 | 257 | return COMPLETE |
245 | 258 |
|
246 | 259 | def _generate_plan(self): |
|
0 commit comments