Skip to content

Commit 8a115bb

Browse files
authored
Merge pull request #121 from waynesun09/centos8
Update suds dependency for CentOS Stream
2 parents b089814 + fb40f2c commit 8a115bb

1 file changed

Lines changed: 21 additions & 14 deletions

File tree

setup.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,37 @@
88
PACKAGE_NAME = "pylero"
99
CLI_NAME = "pylero-cmd"
1010
RELEASE_FILE = "/etc/system-release-cpe"
11-
SUDS_NAME_CHANGE = False
1211

1312
install_requires_ = [
1413
"click",
1514
]
1615

17-
# Update install_requires_ for feodra 36 and greater
16+
# Update install_requires_ for Fedora, CentOS Stream and RHEL
1817
if os.path.exists(RELEASE_FILE):
1918
with open(RELEASE_FILE) as version_file:
2019
version_file_content = version_file.read().split(":")
2120
if (
22-
(version_file_content[3] == "fedora")
23-
and (int(version_file_content[4]) > 35)
24-
) or (
25-
(version_file_content[2] == "redhat")
26-
and (version_file_content[3] == "enterprise_linux")
27-
and (int(version_file_content[4].split(".")[0]) > 8)
21+
(
22+
(version_file_content[3] == "fedora")
23+
and (int(version_file_content[4]) > 35)
24+
)
25+
or (
26+
(version_file_content[2] == "redhat")
27+
and (version_file_content[3] == "enterprise_linux")
28+
and (int(version_file_content[4].split(".")[0]) > 8)
29+
)
30+
or (
31+
(version_file_content[3] == "centos")
32+
and (int(version_file_content[4]) > 8)
33+
)
2834
):
29-
SUDS_NAME_CHANGE = True
30-
31-
if SUDS_NAME_CHANGE:
32-
install_requires_.append("suds")
33-
else:
34-
install_requires_.append("suds-community")
35+
install_requires_.append("suds")
36+
elif (version_file_content[3] == "centos") and (
37+
int(version_file_content[4]) < 9
38+
):
39+
install_requires_.append("suds-jurko")
40+
else:
41+
install_requires_.append("suds-community")
3542

3643

3744
if __name__ == "__main__":

0 commit comments

Comments
 (0)