aanderse / teraflops

a terraform ops tool which is sure to be a flop
MIT License
44 stars 2 forks source link

Unable to run a second time #4

Closed PolarizedIons closed 8 months ago

PolarizedIons commented 8 months ago

Hi, sorry for making so many issues today :D

I get the following if I try run the command again:

 teraflops deploy --reboot              
Traceback (most recent call last):
  File "/nix/store/s0406ii8yby5cgxybfjk4d78gx0xlgva-teraflops-0.0.1/bin/.teraflops-wrapped", line 9, in <module>
    sys.exit(main())
             ^^^^^^
  File "/nix/store/s0406ii8yby5cgxybfjk4d78gx0xlgva-teraflops-0.0.1/lib/python3.12/site-packages/teraflops/main.py", line 907, in main
    app.run()
  File "/nix/store/s0406ii8yby5cgxybfjk4d78gx0xlgva-teraflops-0.0.1/lib/python3.12/site-packages/teraflops/main.py", line 868, in run
    self.generate_arguments_json()
  File "/nix/store/s0406ii8yby5cgxybfjk4d78gx0xlgva-teraflops-0.0.1/lib/python3.12/site-packages/teraflops/main.py", line 143, in generate_arguments_json
    fp.write(json.dumps(self.teraflops_arguments, indent=2, sort_keys=True))
                        ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'App' object has no attribute 'teraflops_arguments'

After some investigation, it seems https://github.com/aanderse/teraflops/blob/a0a2a136b79c2d2ed05cf0abafa0bf64327a2f53/teraflops/main.py#L143 doesn't account for when there is no terraform_data.teraflops-arguments "address" in the teraflops.json file, which seems to be the case for me.

aanderse commented 8 months ago

i didn't do much testing after adding the set-args command the other day...

thanks for catching this, i'll try to put a few minutes aside for testing tonight and write some automated tests hopefully this week

fixed in 0fa6062edbd87a7b8562c379e3e3f285721ee692