Azure / Azure/azure-linux-extensions

DSC & RHEL 8.x & Python > 3.8 not working

Open
#1,612 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
333
Forks
278
Avg merge
2d 9h
Merged PRs (30d)
4

Description

DSC extension is not compatible with Python 3.8 and up

```
2022/10/21 10:16:26 [Microsoft.OSTCExtensions.DSCForLinux] Config decoded correctly.
2022/10/21 10:16:26 Falling back to /etc/os-release distribution parsing
2022/10/21 10:16:26 [Microsoft.OSTCExtensions.DSCForLinux] Install,error,51,rhel; distro_version: 8.5 is not supported.
```

The function platform.dist & platform.linux_distribution are been [removed in python 3.7](https://docs.python.org/3.5/library/platform.html#unix-platforms). So the DSC will use the [Fallback to use /etc/os-release.](https://github.com/Azure/azure-linux-extensions/blob/master/DSC/dsc.py#L158) This is working fine, only that RHEL is using a other name as is then is listed in the suppored_list.

```
# cat /etc/os-release

NAME="Red Hat Enterprise Linux"
VERSION="8.6 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.6"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.6 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/red_hat_enterprise_linux/8/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.6
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.6"
```
The ID in here is `rhel` and this is not listed in the supported_dists list.

Running the function separately shows also this:

```
# python3.6 tmp.py
red hat-->red hat enterprise linux
['8', '6']

# python3.8 tmp.py
Falling back to /etc/os-release distribution parsing
Unsupported OS :rhel; distro_version: 8.6
False
rhel
8.6

# python3.9 tmp.py
Falling back to /etc/os-release distribution parsing
Unsupported OS :rhel; distro_version: 8.6
False
rhel
8.6
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.