-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Continue parsing image argument if aliases doc unreachable #10658
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
Conversation
Currently the Azure CLI does not work in environments without public internet access when trying to use the managed disk image in Azure#5 of the _parse_image_argument function. This fix ignores the ConnectionError in Azure#4 when trying to lookup the aliases doc from `githubusercontent.com` and proceeds to Azure#5. If Azure#5 does not match then it will return the error message: ``` Failed to connect to remote source of image aliases. Invalid image "{}". Use a valid image URN, customer image name, customer image id, or VHD blob URI. See vm create -h for more information on specifying an image. ```
| namespace.os_version = matched['version'] | ||
| return 'urn' | ||
| except requests.exceptions.ConnectionError: | ||
| pass |
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.
we can throw the exception here with the error string you put in the 5th step, since that step won't work anyway
CC: @qwordy
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.
we can throw the exception here with the error string you put in the 5th step, since that step won't work anyway
CC: @qwordy
It can be an existing managed disk image resource.
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.
@yugangw-msft no, that's what we are trying to avoid here. Even on failure in #4, #5 should still be attempted.
| else: | ||
| err = 'Failed to connect to remote source of image aliases. Invalid image "{}". Use a ' \ | ||
| 'valid image URN, custom image name, custom image id, or VHD blob URI.\nSee vm ' \ | ||
| 'create -h for more information on specifying an image.'.format(namespace.image) |
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.
If it's not a valid alias nor an existing image name, what will happen?
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.
If it's not a valid alias then it goes to #5 as before, if it's not the name of an existing managed image it raises the same error message as before.
|
@qwordy any update here? Is this good to merge? |
Merged. |
|
@qwordy Thanks! I know our mutual customers will be happy to hear! |
You are welcome. I plan to add/update the alias file to/in project as a resource file, in each time we build and release. If can't access github, then use the local file. |
Currently the Azure CLI does not work in environments without public internet access when trying to use the managed disk image in
#5of the _parse_image_argument function.This fix ignores the ConnectionError in
#4when trying to lookup the aliases doc fromgithubusercontent.comand proceeds to#5. If#5does not match then it will return the error message:This checklist is used to make sure that common guidelines for a pull request are followed.
The PR has modified HISTORY.rst describing any customer-facing, functional changes. Note that this does not include changes only to help content. (see Modifying change log).
I adhere to the Command Guidelines.