Skip to content

fix: normalize_step crashes with ValueError when --steps passes plain strings #509

@willfrey

Description

@willfrey

Problem

desloppify plan cluster update <name> --steps "step text" "step text" crashes with:

File ".../step_parser.py", line 145, in normalize_step
    return dict(step)
ValueError: dictionary update sequence element #0 has length 1; 2 is required

Repro

desloppify plan cluster update my-cluster --steps "Do thing A" "Do thing B"

Root Cause

normalize_step() in engine/_plan/step_parser.py calls dict(step) which tries to convert a string to a dict. When the --steps CLI arg passes raw strings, they arrive as str not ActionStep (a TypedDict), and dict("string") fails because it interprets each character as a key-value pair.

Workaround

Use --steps-file with a temp file containing numbered steps:

1. Do thing A
2. Do thing B

Fix

In normalize_step, check if step is a string and wrap it as {"title": step} before calling dict(). Or fix the CLI argument parser to construct ActionStep dicts from the string args.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions