Skip to content

Conversation

jsimonweb
Copy link
Contributor

No description provided.

@jsimonweb jsimonweb requested review from enocom and a team September 30, 2021 18:03
@jsimonweb jsimonweb requested a review from a team as a code owner September 30, 2021 18:03
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Sep 30, 2021
@snippet-bot
Copy link

snippet-bot bot commented Sep 30, 2021

Here is the summary of changes.

You are about to add 2 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 30, 2021
@loferris
Copy link
Contributor

loferris commented Oct 1, 2021

code LGTM so far, but we should figure out what's going on with the Python 3.10 build.

Copy link
Member

@enocom enocom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified both MySQL and Postgres work. LGTM.

Would be nice to have a member of @GoogleCloudPlatform/python-samples-owners comment on the use of Python here. I personally don't see any issues, but don't know Python in and out.

return init_tcp_connection_engine(db_config)
if os.environ.get("DB_ROOT_CERT"):
return init_tcp_sslcerts_connection_engine(db_config)
else:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the else isn't needed here as we return, same for the other else.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated as suggested.

# otherwise use DB_PORT environment variable.
host_args = db_host.split(":")
if len(host_args) == 1:
db_hostname = db_host
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looked strange to me since we did the split but then didn't use it. Possibly could reduce that out as well
db_hostname = host_args[0] in both parts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use db_hostname = host_args[0] in both parts as suggested.

@jsimonweb jsimonweb requested a review from crwilcox October 12, 2021 03:27
@jsimonweb jsimonweb merged commit 6d9e108 into GoogleCloudPlatform:master Oct 12, 2021
@jsimonweb jsimonweb deleted the update-cloud-sql-sample-ssl branch October 12, 2021 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants