Skip to content

Make OCI's availability domain required (SC-59)#147

Merged
lucasmoura merged 3 commits into
mainfrom
oci-availability-domain
May 31, 2021
Merged

Make OCI's availability domain required (SC-59)#147
lucasmoura merged 3 commits into
mainfrom
oci-availability-domain

Conversation

@TheRealFalcon
Copy link
Copy Markdown
Contributor

@TheRealFalcon TheRealFalcon commented May 25, 2021

availability_domain used to be able to be inferred from the subnet.
Now it is required to be passed manually.
https://docs.oracle.com/en-us/iaas/tools/python/2.38.3/api/core/models/oci.core.models.Subnet.html#oci.core.models.Subnet.availability_domain

Fixes #138

Comment thread pycloudlib/oci/cloud.py Outdated
def __init__(
self, tag, timestamp_suffix=True, compartment_id=None,
config_path='~/.oci/config',
availability_domain=None, config_path='~/.oci/config',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I know this the default value here is probably to maintain backwards compatibility, but since this a necessary parameter now I think we should not have a default value for it.

Also, I think we should also update the oci example file to include that change as well

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I have always been of the opinion that the common arguments between the clouds (tag and timestamp_suffix) should go first in __init__. Since timestamp_suffix has a default, everything after it would also have to have a default, including "required" arguments.

I know we already have another cloud or two that breaks this, but I was hoping to change it to be consistent, not the other way around. I fine doing whatever the team thinks is best though.

Thanks for the reminder about the example

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

That's a good point about the consistency. Fair enough. I don't see a problem keeping it as it is to enforce that

@TheRealFalcon TheRealFalcon requested a review from lucasmoura May 28, 2021 18:23
@lucasmoura lucasmoura merged commit a30390d into main May 31, 2021
@TheRealFalcon TheRealFalcon deleted the oci-availability-domain branch October 22, 2021 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Null availability_domain for OCI

2 participants