diff options
author | Frederick Lefebvre <fred.lefebvre@gmail.com> | 2019-12-04 09:27:06 -0800 |
---|---|---|
committer | Ryan Harper <ryan.harper@canonical.com> | 2019-12-04 11:27:06 -0600 |
commit | 90535673f580b8819dbb7ea97eb216d0620b86c7 (patch) | |
tree | f5f646c337d524cf5e83769b18a0681d901496c2 /setup.py | |
parent | 7ef655c183b8e1490722053eae9b0f216916c686 (diff) | |
download | vyos-cloud-init-90535673f580b8819dbb7ea97eb216d0620b86c7.tar.gz vyos-cloud-init-90535673f580b8819dbb7ea97eb216d0620b86c7.zip |
setup.py: Amazon Linux sets libexec to /usr/libexec (#52)
Parse /etc/system-release-cpe to detect Amazon Linux and set the proper value.
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -174,6 +174,19 @@ if os.uname()[0] == 'FreeBSD': USR_LIB_EXEC = "usr/local/lib" elif os.path.isfile('/etc/redhat-release'): USR_LIB_EXEC = "usr/libexec" +elif os.path.isfile('/etc/system-release-cpe'): + with open('/etc/system-release-cpe') as f: + cpe_data = f.read().rstrip().split(':') + + if cpe_data[1] == "\o": + # URI formated CPE + inc = 0 + else: + # String formated CPE + inc = 1 + (cpe_vendor, cpe_product, cpe_version) = cpe_data[2+inc:5+inc] + if cpe_vendor == "amazon": + USR_LIB_EXEC = "usr/libexec" class MyEggInfo(egg_info): |