From 326f5c5fa96abe5924512c0477ce161a775c5bdd Mon Sep 17 00:00:00 2001 From: CodyKank Date: Tue, 13 Sep 2016 13:12:52 -0400 Subject: [PATCH] Fixed #2. Issue #2 was caused by the fact that some /etc/os-release 's place quotation marks for their ID's (i.e. ID="antergos") while others do not (i.e. ID=ubuntu). Changed the way the script finds the ID in regards to the quotation marks. --- python_update.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python_update.py b/python_update.py index 486c1b4..ebab1a7 100755 --- a/python_update.py +++ b/python_update.py @@ -77,9 +77,9 @@ def get_system_type(): and others as Arch, and Xubuntu, Ubuntu, and others asd Debian, and Scientific, CentOs, Fedora and others as Red Hat. Method returns the base system as a string.""" - system_id = subprocess.getoutput("cat /etc/os-release | grep 'ID'") - system_id = system_id[system_id.find('"') + 1:] - system_id = system_id[:system_id.find('"')].split()[0] #taking the first result + system_id = subprocess.getoutput("cat /etc/os-release | grep 'ID'").split()[0] + system_id.replace('"', '') # Some systems produce (")'s others do not! + system_id = system_id[system_id.find('=') + 1:] # switch statement wanna-be distro_choices = {'fedora': 'rhel', 'centos': 'rhel', 'scientific': 'rhel', 'rhel': 'rhel', \