This message was deleted.
# general
s
This message was deleted.
l
I should also mention that I've checked the relevant method signatures and it seems that a
force
parameter isn't available.
serialize_args_for_op gave me hope for a moment, but I'm working with LocalWorkspace and....
LocalWorkspace does not utilize this extensibility point.
m
Summoning @limited-rainbow-51650 for this šŸ™‚
l
Thanks! So, I hacked my way around to force things to work. This is probably as dumb as it gets, but it works for my one-off case:
Copy code
from pulumi import automation as auto

class LocalWorkspace(auto.LocalWorkspace):

    def _run_pulumi_cmd_sync(self, args:list, *aargs, **kwargs):

        args.append('--force')
        try:
            return super()._run_pulumi_cmd_sync(args, *aargs, **kwargs)
        except:
            args.pop(args.index('--force'))
            return super()._run_pulumi_cmd_sync(args, *aargs, **kwargs)

auto._local_workspace.LocalWorkspace = LocalWorkspace
Warning: • ^ above block of code blindly pass the
--force
flag to all commands. • I just needed this as a one-off solution, and it shouldn't be considered....for anything ever.
āœ… 1