-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(oracle): add kwargs to utility functions #332
Conversation
596e030
to
7690c90
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the version number, LGTM, thanks!
VERSION
Outdated
@@ -1 +1 @@ | |||
1!5.12.1 | |||
1!5.13.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should reset the patch version to 0.
1!5.13.1 | |
1!5.13.0 |
7690c90
to
23b2329
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, but I do have one inline comment/question.
pycloudlib/oci/utils.py
Outdated
@@ -13,7 +15,9 @@ | |||
log = logging.getLogger(__name__) | |||
|
|||
|
|||
def wait_till_ready(func, current_data, desired_state, sleep_seconds=1000): | |||
def wait_till_ready( | |||
func, current_data, desired_state, sleep_seconds=1000, **kwargs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could lead to some somewhat weird call semantics. For example, with a call like
wait_till_ready(
func=self.compute_client.get_instance,
current_data=self.instance_data,
desired_state="RUNNING",
some_other_kwarg="mykwarg",
)
it's not really obvious that some_other_kwarg
is being used as an argument to the func
. What if the function definition was instead something like
def wait_till_ready(
func, current_data, func_kwargs: Dict, desired_state, sleep_seconds=1000
)
The call to the passed function then looks almost exactly the same:
current_data = func(current_data.id, **func_kwargs).data
but the callsite is a little more clear:
wait_till_ready(
func=self.compute_client.get_instance,
current_data=self.instance_data,
desired_state="RUNNING",
func_kwargs={"some_other_kwarg": "mykwarg"},
)
Thoughts?
23b2329
to
722791a
Compare
722791a
to
ccb0f78
Compare
Changed the function arguments as suggested, and also added the necessary changes to the methods that use this function (and propagated the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Identified issue was addressed
No description provided.