-
Notifications
You must be signed in to change notification settings - Fork 242
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
Conversation
f40009a
to
ec049ed
Compare
@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): |
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 keeping the logic in one function is better.
There is no need to add a new function.
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 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') |
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.
Params_get can read the variants in cfg file directly.
The old code style is not good and looks bad.
@chunfuwen Please help to review this PR. Thanks a lot. :) |
""" | ||
Uri dispatcher. | ||
|
||
:param hostname: String with host name. |
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.
For other parameters e.g vpx_dc,esx_ip=, it also need add doc string
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.
Done. Thanks for the suggestion.
Signed-off-by: vwu-vera <[email protected]>
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
Refer #5048: autotest/tp-libvirt#5048