-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add a check for linux version consistency #5747
Conversation
View a preview at https://prompt.ws/r/Azure/azure-cli/5747 |
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.
Thanks for the PR.
It looks good. Just a few comments.
Later, I will do some local testing of this PR against some different distros etc. to verify further then we can merge.
grep
Outdated
@@ -0,0 +1,55 @@ | |||
DEBUG: Command arguments: ['extension', 'add', '-n', 'azure-cli-iot-ext', '--debug', 'Linux distro check:'] |
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.
Remove this file from the PR.
output.txt
Outdated
@@ -0,0 +1,3495 @@ | |||
DEBUG: Command arguments: ['extension', 'add', '-n', 'azure-cli-iot-ext', '--debug'] |
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.
Remove this file from the PR.
@@ -29,7 +29,7 @@ def ext_add_has_confirmed(command_args): | |||
def transform_extension_list_available(results): | |||
return [OrderedDict([('Name', r)]) for r in results] | |||
|
|||
def validate_extension_add(namespace): | |||
def validate_extension_add(namespace): |
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.
None of the changes in this file are needed so please revert.
logger.debug('Linux distro check: Found in list file: %s', stored_linux_dist_name) | ||
|
||
current_linux_dist_name = platform.linux_distribution()[2] | ||
logger.debug('Linux distro check: Reported by API: %s', current_linux_dist_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.
Put the above 4 lines indented under the above with
statement.
package_source
would be defined in the scope of the with
statement so the other code should be under it.
|
||
except Exception as err: | ||
current_linux_dist_name = "" | ||
stored_linux_dist_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.
Instead of empty string, I'd prefer None
.
@@ -134,8 +138,10 @@ def _add_whl_ext(source, ext_sha256=None, pip_extra_index_urls=None, pip_proxy=N | |||
logger.debug(traceback.format_exc()) | |||
raise CLIError('The extension is invalid. Use --debug for more information.') | |||
except CLIError as e: | |||
raise e | |||
raise e |
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.
These trailing spaces would cause CI to fail.
Applied all the requested changes :) |
And cleaned up last unneeded changes. Now everything is just in custom.py |
Thanks. In setup.py, change the version to |
Done :) |
@yorek Can you rebase your changes on the latest from dev branch? The PR was created before the prev. release so needs to be rebased. Also, please take a look at these failures:
|
Will do. Interesting that pylint did not detect that problems |
Rebasing of "dev" done |
Made all the changes requested in #5675