mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	provision: Include DISTRIB_FAMILY in parse_lsb_release output.
This commit is contained in:
		@@ -341,7 +341,8 @@ def parse_lsb_release():
 | 
			
		||||
            codename = 'rhel' + info[6][0]  # 7
 | 
			
		||||
        distro_info = dict(
 | 
			
		||||
            DISTRIB_CODENAME=codename,
 | 
			
		||||
            DISTRIB_ID=vendor
 | 
			
		||||
            DISTRIB_ID=vendor,
 | 
			
		||||
            DISTRIB_FAMILY='redhat',
 | 
			
		||||
        )
 | 
			
		||||
        return distro_info
 | 
			
		||||
    try:
 | 
			
		||||
@@ -356,6 +357,7 @@ def parse_lsb_release():
 | 
			
		||||
                # from lsb_release in the exception code path.
 | 
			
		||||
                continue
 | 
			
		||||
            distro_info[k] = v
 | 
			
		||||
        distro_info['DISTRIB_FAMILY'] = 'debian'
 | 
			
		||||
    except FileNotFoundError:
 | 
			
		||||
        # Unfortunately, Debian stretch doesn't yet have an
 | 
			
		||||
        # /etc/lsb-release, so we instead fetch the pieces of data
 | 
			
		||||
@@ -364,7 +366,8 @@ def parse_lsb_release():
 | 
			
		||||
        codename = subprocess_text_output(["lsb_release", "-cs"])
 | 
			
		||||
        distro_info = dict(
 | 
			
		||||
            DISTRIB_CODENAME=codename,
 | 
			
		||||
            DISTRIB_ID=vendor
 | 
			
		||||
            DISTRIB_ID=vendor,
 | 
			
		||||
            DISTRIB_FAMILY='debian',
 | 
			
		||||
        )
 | 
			
		||||
    return distro_info
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -120,7 +120,7 @@ if (not is_rhel_based) and (not os.path.exists("/usr/bin/lsb_release")):
 | 
			
		||||
distro_info = parse_lsb_release()
 | 
			
		||||
vendor = distro_info['DISTRIB_ID']
 | 
			
		||||
codename = distro_info['DISTRIB_CODENAME']
 | 
			
		||||
family = 'redhat' if vendor in ['CentOS', 'Fedora', 'RedHat'] else 'debian'
 | 
			
		||||
family = distro_info['DISTRIB_FAMILY']
 | 
			
		||||
if not (vendor in SUPPORTED_PLATFORMS and codename in SUPPORTED_PLATFORMS[vendor]):
 | 
			
		||||
    logging.critical("Unsupported platform: {} {}".format(vendor, codename))
 | 
			
		||||
    sys.exit(1)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user