Skip to content

Diff fails if stack Ignore parameter set to True #1462

@goopilot

Description

@goopilot

Subject of the issue

When running "sceptre diff" on a stack with ignore set to True, getting an error message "ValueError: max() arg is an empty sequence"

Your environment

$ sceptre --version
Sceptre, version 4.4.2

$ python --version
Python 3.8.10

OS: Windows

Steps to reproduce

Set ignore to Trues for any sceptre project:

template:
  type: file
  path: XXXX.yaml
ignore: True

Expected behaviour

Stack should be ignored with corresponding message

Actual behaviour

$ sceptre --var-file vars.yaml --var runlocal=true diff XXXX/YYYYY
Traceback (most recent call last):
File "c:\users\asalamatov\appdata\local\programs\python\python38\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\asalamatov\appdata\local\programs\python\python38\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\asalamatov\AppData\Local\Programs\Python\Python38\Scripts\sceptre.exe_main
.py", line 7, in
File "c:\users\asalamatov\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1157, in call
return self.main(*args, **kwargs)
File "c:\users\asalamatov\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx)
File "c:\users\asalamatov\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\users\asalamatov\appdata\local\programs\python\python38\lib\site-packages\click\decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "c:\users\asalamatov\appdata\local\programs\python\python38\lib\site-packages\sceptre\cli\helpers.py", line 46, in decorated
return func(*args, **kwargs)
File "c:\users\asalamatov\appdata\local\programs\python\python38\lib\site-packages\sceptre\cli\diff.py", line 142 File "c:\users\asalamatov\appdata\local\programs\python\python38\lib\site-packages\click\decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "c:\users\asalamatov\appdata\local\programs\python\python38\lib\site-packages\sceptre\cli\helpers.py", line 46, in decorated
return func(*args, **kwargs)
File "c:\users\asalamatov\appdata\local\programs\python\python38\lib\site-packages\sceptre\cli\diff.py", line 142, in diff_command
num_stacks_with_diff = output_diffs(
File "c:\users\asalamatov\appdata\local\programs\python\python38\lib\site-packages\sceptre\cli\diff.py", line 176, in output_diffs
output_buffer_with_normalized_bar_lengths(line_buffer, output_buffer)
File "c:\users\asalamatov\appdata\local\programs\python\python38\lib\site-packages\sceptre\cli\diff.py", line 190, in output_buffer_with_normalized_bar_lengths
max_length = len(max(buffer, key=len))
ValueError: max() arg is an empty sequence

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions