Skip to content

cli: remove unreachable yaml.safe_loads path #1562

@Elias0419

Description

@Elias0419

Hi

_generate_yaml() in sceptre/cli/helpers.py calls a nonexistent API, yaml.safe_loads (and has for seven years)

https://github.com/Sceptre/sceptre/blame/master/sceptre/cli/helpers.py#L157

Since that code path is unused, it should be removed:

diff --git a/sceptre/cli/helpers.py b/sceptre/cli/helpers.py
index 4fd98c0..168cf3e 100644
--- a/sceptre/cli/helpers.py
+++ b/sceptre/cli/helpers.py
@@ -153,10 +153,7 @@ def _generate_yaml(stream):
         return yaml.dump(stream, **kwargs)
 
     else:
-        try:
-            return yaml.safe_loads(stream)
-        except Exception:
-            return stream
+        return stream

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