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

Add new os name variations to Sensor Download sample #1280

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions samples/sensor_download/download_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def create_constants():
os_name = ""
if args.os:
check_os = args.os.lower()
if check_os in ["rhel", "centos", "oracle", "rhel/centos/oracle"]:
if check_os == "rhel/centos/oracle":
os_name = "RHEL/CentOS/Oracle"
if check_os in ["amzn", "az", "amazon", "amazon linux"]:
os_name = "Amazon Linux"
Expand All @@ -172,6 +172,14 @@ def create_constants():
os_name = "Container"
if check_os in ["idp", "identity", "identity protection"]:
os_name = "Identity*"
if check_os in ["rhel/centos stream/oracle", "stream", "centos stream"]:
os_name = "RHEL/CentOS Stream/Oracle"
if check_os in ["rhel/centos", "centos"]:
os_name = "RHEL/CentOS"
if check_os == "rhel":
os_name = "RHEL"
if check_os == "oracle":
os_name = "Oracle"

os_filter = ""
if os_name:
Expand All @@ -181,7 +189,8 @@ def create_constants():
allowed = ["rhel", "centos", "oracle", "rhel/centos/oracle", "mac", "macos", "apple",
"amzn", "az", "amazon", "amazon linux", "ubuntu", "kali", "deb", "debian",
"sles", "suse", "win", "windows", "microsoft", "container", "docker",
"kubernetes", "idp", "identity", "identity protection"
"kubernetes", "idp", "identity", "identity protection", "stream",
"rhel/centos stream/oracle", "rhel/centos"
]
raise SystemExit(f"Invalid operating system specified.\nAllowed values: {', '.join(allowed)}")
return cmd, args.key, args.secret, os_filter, args.filename, args.table_format, args.all, \
Expand Down
Loading