Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix cfngin diff output lookup resolution when no stack change #208

Merged
merged 1 commit into from
Mar 26, 2020
Merged

fix cfngin diff output lookup resolution when no stack change #208

merged 1 commit into from
Mar 26, 2020

Conversation

ITProKyle
Copy link
Collaborator

Why This Is Needed

Outputs are not being set on the Stack object from Context if the CFN stack reports no change. This causes any output lookups to fail. Output lookups work fine when when the stack being referenced reports changes.

ERROR:runway.cfngin.plan:Couldn't resolve lookup in variable `TestParam`, lookup: ${Lookup<Literal<'output'> Concatenation[Literal<'fake-stack::FakeOutput'>]>}: (<class 'TypeError'>) 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "/Users/kyle/repos/runway/runway/variables.py", line 663, in resolve
    **kwargs)
  File "/Users/kyle/repos/runway/runway/cfngin/lookups/handlers/output.py", line 36, in handle
    return stack.outputs[decon.output_name]
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/kyle/repos/runway/runway/variables.py", line 675, in resolve
    provider=provider))
  File "/Users/kyle/repos/runway/runway/variables.py", line 710, in _resolve_legacy
    provider=provider)
  File "/Users/kyle/repos/runway/runway/cfngin/lookups/handlers/output.py", line 36, in handle
    return stack.outputs[decon.output_name]
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/kyle/repos/runway/runway/variables.py", line 103, in resolve
    variables=variables, **kwargs)
  File "/Users/kyle/repos/runway/runway/variables.py", line 677, in resolve
    raise FailedLookup(self, err2)
runway.cfngin.exceptions.FailedLookup: Failed lookup

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/kyle/repos/runway/runway/cfngin/plan.py", line 142, in _run_once
    status = self.fn(self.stack, status=self.status)
  File "/Users/kyle/repos/runway/runway/cfngin/actions/diff.py", line 177, in _diff_stack
    stack.resolve(self.context, provider)
  File "/Users/kyle/repos/runway/runway/cfngin/stack.py", line 231, in resolve
    resolve_variables(self.variables, context, provider)
  File "/Users/kyle/repos/runway/runway/variables.py", line 39, in resolve_variables
    variable.resolve(context=context, provider=provider)
  File "/Users/kyle/repos/runway/runway/variables.py", line 105, in resolve
    raise FailedVariableLookup(self.name, err.lookup, err.error)
runway.cfngin.exceptions.FailedVariableLookup: Couldn't resolve lookup in variable `TestParam`, lookup: ${Lookup<Literal<'output'> Concatenation[Literal<'fake-stack::FakeOutput'>]>}: (<class 'TypeError'>) 'NoneType' object is not subscriptable
INFO:runway.cfngin.ui:fake-stack-02: failed (Couldn't resolve lookup in variable `TestParam`, lookup: ${Lookup<Literal<'output'> Concatenation[Literal<'fake-stack::FakeOutput'>]>}: (<class 'TypeError'>) 'NoneType' object is not subscriptable)

What Changed

Fixed

  • runway plan for cfngin modules will now properly resolve output lookups when the original stack did not change

Screenshots

image

@ITProKyle ITProKyle added the bug Something isn't working label Mar 26, 2020
@ITProKyle ITProKyle requested a review from troyready March 26, 2020 16:20
@troyready troyready merged commit 3383c76 into rackspace:master Mar 26, 2020
@ITProKyle ITProKyle deleted the bugfix/cfngin-plan-output branch March 26, 2020 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants