flyingcircusio / batou

batou is a universal, fractal deployment utility using Python.
https://batou.readthedocs.org
Other
47 stars 11 forks source link

Secrets become uneditable if you remove hosts #395

Closed ctheune closed 10 months ago

ctheune commented 11 months ago

The editor seems to be performing some kind of validation so that we can't edit secrets after removing a host, causing:

ctheune@chazzzzz ~/Code/flyingcircus/fc-switches-batou (master*) $ ./batou secrets summary
whq
Traceback (most recent call last):
  File "./.appenv/796af443/bin/batou", line 8, in <module>
    sys.exit(main())
  File "/Users/ctheune/Code/flyingcircus/fc-switches-batou/.appenv/796af443/lib/python3.7/site-packages/batou/main.py", line 209, in main
    return args.func(**func_args)
  File "/Users/ctheune/Code/flyingcircus/fc-switches-batou/.appenv/796af443/lib/python3.7/site-packages/batou/secrets/manage.py", line 25, in summary
    environment.load_secrets()
  File "/Users/ctheune/Code/flyingcircus/fc-switches-batou/.appenv/796af443/lib/python3.7/site-packages/batou/environment.py", line 248, in load_secrets
    self.secret_provider.inject_secrets()
  File "/Users/ctheune/Code/flyingcircus/fc-switches-batou/.appenv/796af443/lib/python3.7/site-packages/batou/secrets/__init__.py", line 120, in inject_secrets
    f"Secret for unknown host {hostname}.",
ValueError: Secret for unknown host stan30.

The same is true for editing.