Hi,
Hopefully this is correct place to ask this question.
Preface:
So, I am working with Node and gcloud sdk 0.27.0 on windows machine. My target was to enable integration/acceptance testing against locally emulated datastore. Everything else is running ok, but to ease my load a bit I tried to use '--store-on-disk=False' option so that all entries to datastore would be wiped out at the end. That option, however, seems not to work. I could not find any value that would result in anything else than '--store-on-disk=True' to be set in the end.
Issue:
I am no Python expert, but after debugging start scripts and reading SO I came to conclusion that Python takes command line arguments of boolean type as True if they are present, and hence, it does not matter what value is given, it will always be True.
Possible fix:
I fixed this issue by editing google-cloud-sdk/lib/surface/emulators/datastore/start.py so that '--store-on-disk' parameter defaults to False. Now I can give '--store-on-disk=True' to make it save locally and then just remove that option to prevent it from saving. It still behaves incorrectly in my opinion as it requires value. I was looking to solve it in a way that '--store-on-disk' would enable it and not having that option would disable.
So, is that option defaulting to True a bug, or is my Python magic insufficient to even provide script with a boolean value?
Br,
Teemu