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

sources/azure: set ovf_is_accessible when OVF is read successfully #1193

Merged
merged 1 commit into from
Jan 18, 2022

Conversation

cjp256
Copy link
Contributor

@cjp256 cjp256 commented Jan 14, 2022

The if-statement set ovf_is_accessible to True if the OVF is read
from /dev/sr0, but not from other data sources. It defaults to
True, but may get flipped to False while processing an invalid
source, and never get set back to True when reading from the data
directory.

Instead, default ovf_is_accessible to False, and only set it to
True once we've read an OVF successfully (and end the search).

This fixes an error when OVF is read from data_dir and IMDS
data is unavailable (failing with "No OVF or IMDS available").

Signed-off-by: Chris Patterson cpatterson@microsoft.com

The if-statement set ovf_is_accessible to True if the OVF is read
from /dev/sr0, but not from other data sources.  It defaults to
True, but may get flipped to False while processing an invalid
source, and never get set back to True when reading from the data
directory.

Instead, default ovf_is_accessible to False, and only set it to
True once we've read an OVF successfully (and end the search).

This fixes an error when OVF is read from data_dir and IMDS
data is unavailable (failing with "No OVF or IMDS available").

Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
@cjp256 cjp256 force-pushed the azure-fix-ovf-is-accessible branch from 69fed54 to bdd69ff Compare January 14, 2022 19:37
@cjp256 cjp256 marked this pull request as ready for review January 18, 2022 13:27
Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

Thanks!

@TheRealFalcon TheRealFalcon merged commit 0988fb8 into canonical:main Jan 18, 2022
@cjp256 cjp256 deleted the azure-fix-ovf-is-accessible branch March 29, 2022 14:40
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