Skip to content
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

v2v: add function for vpx without username #3725

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

vwu-vera
Copy link
Contributor

@vwu-vera vwu-vera commented Jul 21, 2023

@vwu-vera
Copy link
Contributor Author

@xiaodwan Please help to review. Thanks.:)

self.vpx_no_username = False
return uri_func()

def get_uri_without_username(self, hostname, vpx_dc=None, esx_ip=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think keeping the logic in one function is better.
There is no need to add a new function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I considered keeping the logic in one function at first.
However, this original func is for public use. If adding the parameters to control the conditions in one func, all calls in other code scripts need to be modified accordingly.
In this consideration, making the func to be isolated only for this case is safer and better.

@@ -182,6 +205,7 @@ def get_cmd_options(self, params):
self.input_file = self.params.get('input_file')
self.new_name = self.params.get('new_name')
self.username = self.params.get('username', 'root')
self.vpx_no_username = self.params.get('vpx_no_username')
Copy link
Contributor

Choose a reason for hiding this comment

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

Params_get can read the variants in cfg file directly.
The old code style is not good and looks bad.

@vwu-vera
Copy link
Contributor Author

@chunfuwen Please help to review this PR. Thanks a lot. :)

"""
Uri dispatcher.

:param hostname: String with host name.
Copy link
Contributor

Choose a reason for hiding this comment

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

For other parameters e.g vpx_dc,esx_ip=, it also need add doc string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Thanks for the suggestion.

Copy link
Contributor

@chunfuwen chunfuwen left a comment

Choose a reason for hiding this comment

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

lgtm

@chunfuwen chunfuwen merged commit 77c9a17 into avocado-framework:master Jul 26, 2023
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.

3 participants