https://pulumi.com logo
#python
Title
# python
v

victorious-exabyte-70545

09/22/2021, 10:14 PM
Looks like it expects program (callable) to be provided for local workspace but that should not be included with work_dir provided.
r

red-match-15116

09/22/2021, 10:23 PM
Hi! Is that your entire code sample?
That is pretty surprising since we have tests for these scenarios
v

victorious-exabyte-70545

09/22/2021, 10:27 PM
The only other part of code is
Copy code
from pulumi import automation as auto
@red-match-15116 Thanks for looking.
Copy code
(sourcescrub) Julians-MacBook-Pro:bare julian$ ls
Pulumi.dev.yaml		Pulumi.staging.yaml	__main__.py
Pulumi.prod.yaml	Pulumi.yaml
These are the contents of the directory.
r

red-match-15116

09/22/2021, 10:30 PM
I think I see what the issue is. It’s a bug on our end.
v

victorious-exabyte-70545

09/22/2021, 10:30 PM
Copy code
auto.select_stack("dev", work_dir=".")
oh cool. is there a version I can upgrade to?
or downgrade to?
if the pr is public can you send me the link? interested in what the issue was.
r

red-match-15116

09/22/2021, 10:31 PM
I think it’s because IPython is trying to print the LocalWorkspace object and it’s failing because its not correctly configured. I’m gonna fix it now but the point release might be in a couple of days.
Yeah one sec.
v

victorious-exabyte-70545

09/22/2021, 10:32 PM
oh, will this work outside of ipython?
have not tried that.
r

red-match-15116

09/22/2021, 10:32 PM
Yes it should work outside of IPython.
v

victorious-exabyte-70545

09/22/2021, 10:32 PM
oh cool.
r

red-match-15116

09/22/2021, 10:33 PM
The problem is basically that IPython is trying to run
print(stack)
and the printable version of
Stack
is broken when there isn’t a program.
v

victorious-exabyte-70545

09/22/2021, 10:33 PM
right.
Copy code
program.__name__
program callable was not provided (or needed)
💯 1
Thanks for your help on this!
r

red-match-15116

09/22/2021, 10:35 PM
Yup exactly. I’m pushing up a fix now. Sorry about this!
v

victorious-exabyte-70545

09/22/2021, 11:15 PM
conditional in a format string. Nice!
Thanks for sharing the PR.
Hmmm. Getting it with outside of ipython
r

red-match-15116

09/22/2021, 11:27 PM
I can only get this to throw if I run
print(stack)
Which it appears you are doing.
Copy code
"/Users/julian/git/sourcescrub/sourcescrub.azureinfrastructure/infra/lib/pulumi_helpers.py", line 49, in deploy_project
    print(stack)
v

victorious-exabyte-70545

09/22/2021, 11:27 PM
ahh good point.
Thanks.
partypus 8bit 1
👍🏽 1
r

red-match-15116

09/22/2021, 11:31 PM
np!
v

victorious-exabyte-70545

10/19/2021, 6:40 PM
Hey Komal! I really appreciated your help on my last issue. Question, is there a way to unit test my pulumi IOC without network connectivity. I guess this is an azure specific question (I will ask in channel). When I worked with AWS I used a library called boto to mock AWS's api. It was awesome because every cloud formation template generated was tested (all resources mock created). Would love to do this with pulumi and azure.
r

red-match-15116

10/19/2021, 7:50 PM
Hey! You can write mocks following the guide here: https://www.pulumi.com/docs/guides/testing/unit/
👍 1
2 Views