pulumi-scaleway icon indicating copy to clipboard operation
pulumi-scaleway copied to clipboard

[get_object_bucket] AttributeError: type object 'InvokeOptions' has no attribute 'merge'

Open idrissneumann opened this issue 1 year ago • 1 comments

Hi.

We recently upgraded from 0.1.8 to 1.7.0 and implement a "refresh" function (to help reimporting the state of existing buckets).

We got this errors:

error: an unhandled error occurred: python inline source runtime error: type object 'InvokeOptions' has no attribute 'merge'
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pulumi/automation/_server.py", line 69, in Run
    loop.run_until_complete(run_in_stack(self.program))
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 126, in run_in_stack
    await run_pulumi_func(lambda: Stack(func))
  File "/usr/local/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 49, in run_pulumi_func
    func()
  File "/usr/local/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 126, in <lambda>
    await run_pulumi_func(lambda: Stack(func))
  File "/usr/local/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 149, in __init__
    func()
  File "/app/src/strategies/ScalewayStrategy.py", line 128, in create_pulumi_program
    existing_bucket = scaleway.get_object_bucket(name=hashed_bucket_name)
  File "/usr/local/lib/python3.9/site-packages/lbrlabs_pulumi_scaleway/get_object_bucket.py", line 189, in get_object_bucket
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
AttributeError: type object 'InvokeOptions' has no attribute 'merge'

Here's our code to reproduce this issue:

 def create_pulumi_program():
    existing_bucket = scaleway.get_object_bucket(name=bucket_name)
    pulumi.export("type", existing_bucket.type)

stack = auto.create_or_select_stack(stack_name=bucket_name, project_name=bucket_name, program=create_pulumi_program)

I think it's not related to the upgrade since we upgraded in order to be able to call the get_object_bucket which seems not exists in the older version.

Thanks for your help.

idrissneumann avatar Mar 04 '23 10:03 idrissneumann