Skip to content

fix vmaccess for opensuse 15#917

Merged
D1v38om83r merged 1 commit intoAzure:masterfrom
D1v38om83r:bhbrahma/VmAccess-opensuse15
Oct 8, 2019
Merged

fix vmaccess for opensuse 15#917
D1v38om83r merged 1 commit intoAzure:masterfrom
D1v38om83r:bhbrahma/VmAccess-opensuse15

Conversation

@D1v38om83r
Copy link
Contributor

No description provided.

@D1v38om83r D1v38om83r requested a review from vrdmr as a code owner October 7, 2019 22:53
os_release_filepath = "/etc/os-release"
if not os.path.isfile(os_release_filepath):
return ["","",""]
info = open(os_release_filepath).readlines()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this throw if we don't have the permissions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OS release is readable for everyone in every distro. Yes, it could throw if somebody were to lock down something as fundamental as /etc/os-release but that would be a really far-fetched corner case.

Comment on lines 6510 to +6513
if not distinfo[0]:
distinfo = dist_info_SLES15()
if not distinfo[0]:
distinfo = dist_info_opensuse15()
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems rather inefficient. Why not have one method that figures out the distinfo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fix is needed because the library we use to determine the OS and distro fails for newer distros which stopped having release files like they used to, e.g. /etc/suse-release has been dropped in newer distors in favor of /etc/os-release.

We have had to add such methods do deal with these cases since we can't rely on one single method to determine distinfo

@D1v38om83r D1v38om83r merged commit 76fe7cf into Azure:master Oct 8, 2019
@D1v38om83r D1v38om83r deleted the bhbrahma/VmAccess-opensuse15 branch April 16, 2020 22:02
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