#!/usr/bin/env python #coding: utf-8 import platform def cg_is_redhat_6x(): try: os_vers = platform.linux_distribution() os_name = os_vers[0].lower() if os_name.find('centos', 0) == 0 or os_name.find('red hat', 0) == 0: if os_vers[1][0:2] == '6.': return True except: cg_print('EXECEPT! It\'s not clear whether Redhar/CentOS 6x.') return False return False