diff --git a/.gitignore b/.gitignore index 6c177b4..8d4b341 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/insights-client-3.0.3.tar.gz +SOURCES/insights-client-3.0.6.tar.gz diff --git a/.insights-client.metadata b/.insights-client.metadata index 9685f1c..1d1539c 100644 --- a/.insights-client.metadata +++ b/.insights-client.metadata @@ -1 +1 @@ -6314d8d2eb1c7f687cbfc74852ff8e2ac0af2ed2 SOURCES/insights-client-3.0.3.tar.gz +9f57aabd4bd09f2ef6ba92c239442979267bd398 SOURCES/insights-client-3.0.6.tar.gz diff --git a/SOURCES/0001-Bump-release.patch b/SOURCES/0001-Bump-release.patch deleted file mode 100644 index c742fbc..0000000 --- a/SOURCES/0001-Bump-release.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 80358d2db05977fbe9e6612ad647b10453b64ba9 Mon Sep 17 00:00:00 2001 -From: Kyle Lape -Date: Wed, 7 Feb 2018 10:02:24 -0600 -Subject: [PATCH] Bump release - ---- - insights_client/constants.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/insights_client/constants.py b/insights_client/constants.py -index 3cbbebb..e57b7e6 100644 ---- a/insights_client/constants.py -+++ b/insights_client/constants.py -@@ -5,4 +5,4 @@ Constants - - class InsightsConstants(object): - app_name = 'insights-client' -- version = '3.0.3-1' -+ version = '3.0.3-2' --- -2.14.3 - diff --git a/SOURCES/0002-Bump-release-again.patch b/SOURCES/0002-Bump-release-again.patch deleted file mode 100644 index 2fec980..0000000 --- a/SOURCES/0002-Bump-release-again.patch +++ /dev/null @@ -1,22 +0,0 @@ -From a7c23e89a1dfd1c61ad09d410e758c515440d16b Mon Sep 17 00:00:00 2001 -From: Kyle Lape -Date: Thu, 8 Feb 2018 12:13:36 -0600 -Subject: [PATCH] Bump release again - ---- - insights_client/constants.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/insights_client/constants.py b/insights_client/constants.py -index e57b7e6..4e77354 100644 ---- a/insights_client/constants.py -+++ b/insights_client/constants.py -@@ -5,4 +5,4 @@ Constants - - class InsightsConstants(object): - app_name = 'insights-client' -- version = '3.0.3-2' -+ version = '3.0.3-3' --- -2.14.3 - diff --git a/SOURCES/0003-Bump-release-to-4.patch b/SOURCES/0003-Bump-release-to-4.patch deleted file mode 100644 index d12c831..0000000 --- a/SOURCES/0003-Bump-release-to-4.patch +++ /dev/null @@ -1,22 +0,0 @@ -From f8fc07787591af5f4ccd1ed24cdef30b5871c799 Mon Sep 17 00:00:00 2001 -From: Kyle Lape -Date: Thu, 8 Feb 2018 13:05:00 -0600 -Subject: [PATCH] Bump release to 4 - ---- - insights_client/constants.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/insights_client/constants.py b/insights_client/constants.py -index 4e77354..4784e67 100644 ---- a/insights_client/constants.py -+++ b/insights_client/constants.py -@@ -5,4 +5,4 @@ Constants - - class InsightsConstants(object): - app_name = 'insights-client' -- version = '3.0.3-3' -+ version = '3.0.3-4' --- -2.14.3 - diff --git a/SOURCES/0004-Scheduling-should-enable-disable-systemd-timer.patch b/SOURCES/0004-Scheduling-should-enable-disable-systemd-timer.patch deleted file mode 100644 index 698f31e..0000000 --- a/SOURCES/0004-Scheduling-should-enable-disable-systemd-timer.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 2a224bf7db61094892e0e5ee0cea2c39ce448ecd Mon Sep 17 00:00:00 2001 -From: Kyle Lape -Date: Thu, 15 Feb 2018 13:00:55 -0600 -Subject: [PATCH] Scheduling should enable/disable systemd timer - -in addition to start/stop ---- - insights/client/schedule.py | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/egg/insights/client/schedule.py b/egg/insights/client/schedule.py -index 4a2da14b..404c1aa8 100644 ---- a/egg/insights/client/schedule.py -+++ b/egg/insights/client/schedule.py -@@ -56,7 +56,7 @@ class InsightsSchedulerSystemd(object): - @property - def active(self): - try: -- systemctl_status = run_command_get_output('systemctl is-active insights-client.timer') -+ systemctl_status = run_command_get_output('systemctl is-enabled insights-client.timer') - return systemctl_status['status'] == 0 - except OSError: - logger.exception('Could not get systemd status') -@@ -67,6 +67,7 @@ class InsightsSchedulerSystemd(object): - try: - # Start timers in the case of rhel 7 running systemd - systemctl_timer = run_command_get_output('systemctl start insights-client.timer') -+ systemctl_timer = run_command_get_output('systemctl enable insights-client.timer') - logger.debug("Starting Insights Client systemd timer.") - logger.debug("Status: %s", systemctl_timer['status']) - logger.debug("Output: %s", systemctl_timer['output']) -@@ -79,6 +80,7 @@ class InsightsSchedulerSystemd(object): - logger.debug('Stopping all systemd timers') - try: - # Stop timers in the case of rhel 7 running systemd -+ systemctl_timer = run_command_get_output('systemctl disable insights-client.timer') - systemctl_timer = run_command_get_output('systemctl stop insights-client.timer') - logger.debug("Stopping Insights Client systemd timer.") - logger.debug("Status: %s", systemctl_timer['status']) --- -2.14.3 - diff --git a/SOURCES/0005-Bump-egg-release-to-3.patch b/SOURCES/0005-Bump-egg-release-to-3.patch deleted file mode 100644 index 6911ecc..0000000 --- a/SOURCES/0005-Bump-egg-release-to-3.patch +++ /dev/null @@ -1,19 +0,0 @@ -From d3c11cfc25c202f467e4b56b82b00f5a98380267 Mon Sep 17 00:00:00 2001 -From: Kyle Lape -Date: Thu, 15 Feb 2018 13:22:01 -0600 -Subject: [PATCH] Bump egg release to 3 - ---- - insights/RELEASE | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/egg/insights/RELEASE b/egg/insights/RELEASE -index 0cfbf088..00750edc 100644 ---- a/egg/insights/RELEASE -+++ b/egg/insights/RELEASE -@@ -1 +1 @@ --2 -+3 --- -2.14.3 - diff --git a/SOURCES/0006-Bump-release-to-5.patch b/SOURCES/0006-Bump-release-to-5.patch deleted file mode 100644 index a5d9a43..0000000 --- a/SOURCES/0006-Bump-release-to-5.patch +++ /dev/null @@ -1,22 +0,0 @@ -From f8fc07787591af5f4ccd1ed24cdef30b5871c799 Mon Sep 17 00:00:00 2001 -From: Kyle Lape -Date: Thu, 8 Feb 2018 13:05:00 -0600 -Subject: [PATCH] Bump release to 4 - ---- - insights_client/constants.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/insights_client/constants.py b/insights_client/constants.py -index 4e77354..4784e67 100644 ---- a/insights_client/constants.py -+++ b/insights_client/constants.py -@@ -5,4 +5,4 @@ Constants - - class InsightsConstants(object): - app_name = 'insights-client' -- version = '3.0.3-4' -+ version = '3.0.3-5' --- -2.14.3 - diff --git a/SOURCES/0007-Removing-magic.py.patch b/SOURCES/0007-Removing-magic.py.patch deleted file mode 100644 index d448eba..0000000 --- a/SOURCES/0007-Removing-magic.py.patch +++ /dev/null @@ -1,227 +0,0 @@ -From 7c122f3920f6ba6c4fb22f5b09dfb29a861396cb Mon Sep 17 00:00:00 2001 -From: rpm-build -Date: Fri, 16 Feb 2018 09:11:32 -0600 -Subject: [PATCH] Removing magic.py - ---- - egg/insights/contrib/magic.py | 208 ------------------------------------------ - 1 file changed, 208 deletions(-) - delete mode 100644 egg/insights/contrib/magic.py - -diff --git a/egg/insights/contrib/magic.py b/egg/insights/contrib/magic.py -deleted file mode 100644 -index 8cb7130..0000000 ---- a/egg/insights/contrib/magic.py -+++ /dev/null -@@ -1,208 +0,0 @@ --#!/usr/bin/env python --''' --Python bindings for libmagic --''' -- --import ctypes -- --from ctypes import * --from ctypes.util import find_library -- -- --def _init(): -- """ -- Loads the shared library through ctypes and returns a library -- L{ctypes.CDLL} instance -- """ -- return ctypes.cdll.LoadLibrary(find_library('magic')) -- --_libraries = {} --_libraries['magic'] = _init() -- --# Flag constants for open and setflags --MAGIC_NONE = NONE = 0 --MAGIC_DEBUG = DEBUG = 1 --MAGIC_SYMLINK = SYMLINK = 2 --MAGIC_COMPRESS = COMPRESS = 4 --MAGIC_DEVICES = DEVICES = 8 --MAGIC_MIME_TYPE = MIME_TYPE = 16 --MAGIC_CONTINUE = CONTINUE = 32 --MAGIC_CHECK = CHECK = 64 --MAGIC_PRESERVE_ATIME = PRESERVE_ATIME = 128 --MAGIC_RAW = RAW = 256 --MAGIC_ERROR = ERROR = 512 --MAGIC_MIME_ENCODING = MIME_ENCODING = 1024 --MAGIC_MIME = MIME = 1040 --MAGIC_APPLE = APPLE = 2048 -- --MAGIC_NO_CHECK_COMPRESS = NO_CHECK_COMPRESS = 4096 --MAGIC_NO_CHECK_TAR = NO_CHECK_TAR = 8192 --MAGIC_NO_CHECK_SOFT = NO_CHECK_SOFT = 16384 --MAGIC_NO_CHECK_APPTYPE = NO_CHECK_APPTYPE = 32768 --MAGIC_NO_CHECK_ELF = NO_CHECK_ELF = 65536 --MAGIC_NO_CHECK_TEXT = NO_CHECK_TEXT = 131072 --MAGIC_NO_CHECK_CDF = NO_CHECK_CDF = 262144 --MAGIC_NO_CHECK_TOKENS = NO_CHECK_TOKENS = 1048576 --MAGIC_NO_CHECK_ENCODING = NO_CHECK_ENCODING = 2097152 -- --MAGIC_NO_CHECK_BUILTIN = NO_CHECK_BUILTIN = 4173824 -- -- --class magic_set(Structure): -- pass --magic_set._fields_ = [] --magic_t = POINTER(magic_set) -- --_open = _libraries['magic'].magic_open --_open.restype = magic_t --_open.argtypes = [c_int] -- --_close = _libraries['magic'].magic_close --_close.restype = None --_close.argtypes = [magic_t] -- --_file = _libraries['magic'].magic_file --_file.restype = c_char_p --_file.argtypes = [magic_t, c_char_p] -- --_descriptor = _libraries['magic'].magic_descriptor --_descriptor.restype = c_char_p --_descriptor.argtypes = [magic_t, c_int] -- --_buffer = _libraries['magic'].magic_buffer --_buffer.restype = c_char_p --_buffer.argtypes = [magic_t, c_void_p, c_size_t] -- --_error = _libraries['magic'].magic_error --_error.restype = c_char_p --_error.argtypes = [magic_t] -- --_setflags = _libraries['magic'].magic_setflags --_setflags.restype = c_int --_setflags.argtypes = [magic_t, c_int] -- --_load = _libraries['magic'].magic_load --_load.restype = c_int --_load.argtypes = [magic_t, c_char_p] -- --_compile = _libraries['magic'].magic_compile --_compile.restype = c_int --_compile.argtypes = [magic_t, c_char_p] -- --_check = _libraries['magic'].magic_check --_check.restype = c_int --_check.argtypes = [magic_t, c_char_p] -- --_errno = _libraries['magic'].magic_errno --_errno.restype = c_int --_errno.argtypes = [magic_t] -- -- --class Magic(object): -- def __init__(self, ms): -- self._magic_t = ms -- -- def close(self): -- """ -- Closes the magic database and deallocates any resources used. -- """ -- _close(self._magic_t) -- -- def file(self, filename): -- """ -- Returns a textual description of the contents of the argument passed -- as a filename or None if an error occurred and the MAGIC_ERROR flag -- is set. A call to errno() will return the numeric error code. -- """ -- try: # attempt python3 approach first -- if isinstance(filename, bytes): -- bi = filename -- else: -- bi = bytes(filename, 'utf-8') -- return str(_file(self._magic_t, bi), 'utf-8') -- except: -- return _file(self._magic_t, filename.encode('utf-8')) -- -- def descriptor(self, fd): -- """ -- Like the file method, but the argument is a file descriptor. -- """ -- return _descriptor(self._magic_t, fd) -- -- def buffer(self, buf): -- """ -- Returns a textual description of the contents of the argument passed -- as a buffer or None if an error occurred and the MAGIC_ERROR flag -- is set. A call to errno() will return the numeric error code. -- """ -- try: # attempt python3 approach first -- return str(_buffer(self._magic_t, buf, len(buf)), 'utf-8') -- except: -- return _buffer(self._magic_t, buf, len(buf)) -- -- def error(self): -- """ -- Returns a textual explanation of the last error or None -- if there was no error. -- """ -- try: # attempt python3 approach first -- return str(_error(self._magic_t), 'utf-8') -- except: -- return _error(self._magic_t) -- -- def setflags(self, flags): -- """ -- Set flags on the magic object which determine how magic checking -- behaves; a bitwise OR of the flags described in libmagic(3), but -- without the MAGIC_ prefix. -- -- Returns -1 on systems that don't support utime(2) or utimes(2) -- when PRESERVE_ATIME is set. -- """ -- return _setflags(self._magic_t, flags) -- -- def load(self, filename=None): -- """ -- Must be called to load entries in the colon separated list of database -- files passed as argument or the default database file if no argument -- before any magic queries can be performed. -- -- Returns 0 on success and -1 on failure. -- """ -- return _load(self._magic_t, filename) -- -- def compile(self, dbs): -- """ -- Compile entries in the colon separated list of database files -- passed as argument or the default database file if no argument. -- Returns 0 on success and -1 on failure. -- The compiled files created are named from the basename(1) of each file -- argument with ".mgc" appended to it. -- """ -- return _compile(self._magic_t, dbs) -- -- def check(self, dbs): -- """ -- Check the validity of entries in the colon separated list of -- database files passed as argument or the default database file -- if no argument. -- Returns 0 on success and -1 on failure. -- """ -- return _check(self._magic_t, dbs) -- -- def errno(self): -- """ -- Returns a numeric error code. If return value is 0, an internal -- magic error occurred. If return value is non-zero, the value is -- an OS error code. Use the errno module or os.strerror() can be used -- to provide detailed error information. -- """ -- return _errno(self._magic_t) -- -- --def open(flags): -- """ -- Returns a magic object on success and None on failure. -- Flags argument as for setflags. -- """ -- return Magic(_open(flags)) --- -2.14.3 - diff --git a/SOURCES/0008-Resolving-differences-between-build-metadata.patch b/SOURCES/0008-Resolving-differences-between-build-metadata.patch deleted file mode 100644 index 2ecf60a..0000000 --- a/SOURCES/0008-Resolving-differences-between-build-metadata.patch +++ /dev/null @@ -1,47 +0,0 @@ -From c22aec043ba4671561bfcfa7596ced69e31c7fab Mon Sep 17 00:00:00 2001 -From: rpm-build -Date: Fri, 16 Feb 2018 09:51:14 -0600 -Subject: [PATCH] Resolving differences between build metadata - -This is to enable bit-for-bit reproducible eggs ---- - egg/EGG-INFO/PKG-INFO | 1 + - egg/EGG-INFO/requires.txt | 4 ++-- - 2 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/egg/EGG-INFO/PKG-INFO b/egg/EGG-INFO/PKG-INFO -index f72b3fb..4fca0b8 100644 ---- a/egg/EGG-INFO/PKG-INFO -+++ b/egg/EGG-INFO/PKG-INFO -@@ -6,6 +6,7 @@ Home-page: https://github.com/redhatinsights/insights-core - Author: Red Hat, Inc. - Author-email: insights@redhat.com - License: Apache 2.0 -+Description-Content-Type: UNKNOWN - Description: ============= - Insights Core - ============= -diff --git a/egg/EGG-INFO/requires.txt b/egg/EGG-INFO/requires.txt -index db82e21..23dd4fc 100644 ---- a/egg/EGG-INFO/requires.txt -+++ b/egg/EGG-INFO/requires.txt -@@ -1,14 +1,14 @@ - Jinja2==2.9.6 - argparse - importlib --pyyaml>=3.10,<=3.12 -+pyyaml<=3.12,>=3.10 - pyOpenSSL - six - requests - - [develop] - wheel --pyyaml>=3.10,<=3.12 -+pyyaml<=3.12,>=3.10 - Sphinx - futures==3.0.5 - flake8==3.3.0 --- -2.14.3 - diff --git a/SOURCES/0009-Bump-release-to-6.patch b/SOURCES/0009-Bump-release-to-6.patch deleted file mode 100644 index bde1ab2..0000000 --- a/SOURCES/0009-Bump-release-to-6.patch +++ /dev/null @@ -1,22 +0,0 @@ -From f8fc07787591af5f4ccd1ed24cdef30b5871c799 Mon Sep 17 00:00:00 2001 -From: Kyle Lape -Date: Thu, 8 Feb 2018 13:05:00 -0600 -Subject: [PATCH] Bump release to 4 - ---- - insights_client/constants.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/insights_client/constants.py b/insights_client/constants.py -index 4e77354..4784e67 100644 ---- a/insights_client/constants.py -+++ b/insights_client/constants.py -@@ -5,4 +5,4 @@ Constants - - class InsightsConstants(object): - app_name = 'insights-client' -- version = '3.0.3-5' -+ version = '3.0.3-6' --- -2.14.3 - diff --git a/SOURCES/0010-Updating-egg-signature.patch b/SOURCES/0010-Updating-egg-signature.patch deleted file mode 100644 index 1505346..0000000 --- a/SOURCES/0010-Updating-egg-signature.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 0698d4a7fec8a3240cdaff94614f8a32c25d339d Mon Sep 17 00:00:00 2001 -From: rpm-build -Date: Mon, 19 Feb 2018 08:32:49 -0600 -Subject: [PATCH] Updating egg signature - ---- - etc/rpm.egg.asc | 26 +++++++++++++------------- - 1 file changed, 13 insertions(+), 13 deletions(-) - -diff --git a/etc/rpm.egg.asc b/etc/rpm.egg.asc -index c43031a..21d8b0a 100644 ---- a/etc/rpm.egg.asc -+++ b/etc/rpm.egg.asc -@@ -1,17 +1,17 @@ - -----BEGIN PGP SIGNATURE----- - Version: GnuPG v1 - --iQIVAwUAWmuA7XUU932DZrDZAQic/xAAlc7I+VT2y4Ok7mu5OJKerWooo0a77Tw8 --zjciAT8QuhmJJkYqJIpDdWYCwQdDMTrYwf4fyyBM7Y/e0aAavYsJy8vo/LD80Yx8 --7ZaWgN/dJbPacLSurCaMV044vAoIh2K0qvKYEZjK8JRtaMWQDKEkjQ24Hryw7pbo --D+U6R5iXmaJ30s4BEnwB3skeBKzrXTL8o0usS7E56InL7nVFqS/63z5P7TYD+Ym6 --eRrb0REavSNb6w6P92Wg9ks1ZzGV013kHAw0NmD/AF1ZMGhZZ1RMFXPevOwbvPLH --eChxkaNsB5oaWix4XQUcYpRQBdOdZ0ViOkZ4DTRAW0EYjSACpFa+6yzD+huMgqpo --Tf4183e0LuAEQf/p7bqbb7rhXLJPW9mSeAkxeI7EvC0ZGrbui4c1Smui9/+m4FBo --b5vAkc5iNv9SuzI0tPgJI8npkqVQAP9/v41ygvw1rFPsTrJ65i9hZwPcmDDZqaro --TlSV7XIdgtz8OjLtfI0b+jtpLU/pYD0Y4VsGEouoIdpd2nkc9tOpWF9+Wkg+42o4 --1jhVCvn9/6QrBl7nrFVAhwDNIc1B6f2++i+ag/+ZypJOQZ09baSc2k7cgeisoioO --+nPBrrSfB4Wnbjoz+JNjlLS3omablBEiEC2zNGZipX+60NQHTLxLP0rmuqElxONI --G6oWPLrspTg= --=Dp1c -+iQIVAwUAWorgBXUU932DZrDZAQgosBAAjpQ9pZcRcmMfDTNu3lT0RB59+7Rji368 -+UJFQ7NgUuK/paQNE/JnDx8kPsigPYiwSnhZuy34nnkFoPwH7e9igzofwyshiljH0 -+29XCznBKHsnPRbIX7kuqEs2chn2bbHX3+uZgfvipLbxm4UuQ2n5hH2AT4saVFtiO -+qNFKIdQ9ib7EGfnuSF7NV9E+WbEu+/ZORxsE/ceKkIYsKdAPiT2TcCIY6y4+B6Kq -+UCFxoCHIwrAaWoSKixkUpr3N3JkzyA6rf38n3sj2+MMNztmnSyCgt1twVmNgj7Mf -+01Jea5m+ETSuzXBBSZ1iTHUv2AjgsLrufWyIrOBYRKjzIBXKdS1KaLO/kPC++s8+ -+lxsEp3mNktCAcl22og5R8pcy9pGTuXUp0JxbblXI/4V3qjCNxA0pgCAL+18hg9Rg -+1wU0tJQzFJCmzMNT3WSYzmcbW6uwNTtE50mznxbq3dxoTGd8K/DL+LPsVvYTKDHf -+fmipIPnHqef0YX2b7IRnZ1WHSrm4vlpJuE+DYUqefFQHirh8Dl/mbcYCtNgENNnd -+/FaHmehPrjK+CdLC1+t7lAUg6nQAxCnZTYcxQWVG4yA9x3NT2GOSZQZI82D9F6cq -+XFh3GdKv8CnmaoFl51McfQ92v33Lejw/C5I59wr1gn85Q3U3qDlXILPGLHS54cXH -+28mu//8I/0k= -+=VCaP - -----END PGP SIGNATURE----- --- -2.14.3 - diff --git a/SOURCES/0011-Bump-release-to-7.patch b/SOURCES/0011-Bump-release-to-7.patch deleted file mode 100644 index 376ca08..0000000 --- a/SOURCES/0011-Bump-release-to-7.patch +++ /dev/null @@ -1,22 +0,0 @@ -From f8fc07787591af5f4ccd1ed24cdef30b5871c799 Mon Sep 17 00:00:00 2001 -From: Kyle Lape -Date: Mon, 19 Feb 2018 13:05:00 -0600 -Subject: [PATCH] Bump release to 7 - ---- - insights_client/constants.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/insights_client/constants.py b/insights_client/constants.py -index 4e77354..4784e67 100644 ---- a/insights_client/constants.py -+++ b/insights_client/constants.py -@@ -5,4 +5,4 @@ Constants - - class InsightsConstants(object): - app_name = 'insights-client' -- version = '3.0.3-6' -+ version = '3.0.3-7' --- -2.14.3 - diff --git a/SOURCES/0012-GPG-verify-egg-in-parent-process.patch b/SOURCES/0012-GPG-verify-egg-in-parent-process.patch deleted file mode 100644 index 2b8f398..0000000 --- a/SOURCES/0012-GPG-verify-egg-in-parent-process.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 46b817b8c7e7d66ee91f9f47c00e96d5afa8a18e Mon Sep 17 00:00:00 2001 -From: Kyle Lape -Date: Fri, 23 Feb 2018 12:52:04 -0600 -Subject: [PATCH] GPG verify egg in parent process - -This fixes issue #54. - -- Add GPG verification code (instead of relying on code from egg) - -- Enable bypass via environment variable BYPASS_GPG. The process only - recognizes the value "true" (case insensitive); all other values resolve - to false. This only applies to the GPG verification done in the parent - process; eggs loaded in subprocess (i.e. phases) still use --no-gpg. - -- If last_stable.egg cannot be GPG verified, try rpm.egg. If rpm.egg is - verified, use it instead of last_stable.egg. If rpm.egg cannot be - verified, either, then print an error message and exit. - -- A debug logging statement is added after logging has been set up to - indicate which egg was loaded in the parent process. - Look for string: "Loaded initial egg". ---- - insights_client/__init__.py | 25 ++++++++++++++++++++++++- - 1 file changed, 24 insertions(+), 1 deletion(-) - -diff --git a/insights_client/__init__.py b/insights_client/__init__.py -index d8932f5..fd2adf0 100644 ---- a/insights_client/__init__.py -+++ b/insights_client/__init__.py -@@ -9,9 +9,14 @@ import grp - import os - import sys - import subprocess -+from subprocess import PIPE -+import shlex - import logging - import logging.handlers - -+GPG_KEY = "/etc/insights-client/redhattools.pub.gpg" -+ -+BYPASS_GPG = os.environ.get("BYPASS_GPG", "").lower() == "true" - ENV_EGG = os.environ.get("EGG") - NEW_EGG = "/var/lib/insights/newest.egg" - STABLE_EGG = "/var/lib/insights/last_stable.egg" -@@ -44,6 +49,17 @@ def demote(uid, gid, run_as_root): - return result - - -+def gpg_validate(path): -+ if BYPASS_GPG: -+ return True -+ -+ gpg_template = '/usr/bin/gpg --verify --keyring %s %s %s' -+ cmd = gpg_template % (GPG_KEY, path + '.asc', path) -+ proc = subprocess.Popen(shlex.split(cmd), stdout=PIPE, stderr=PIPE) -+ proc.communicate() -+ return proc.returncode == 0 -+ -+ - def run_phase(phase, client): - """ - Call the run script for the given phase. If the phase succeeds returns the -@@ -106,10 +122,16 @@ def _main(): - if not all(map(None, [insights_uid, insights_gid, insights_grpid])): - sys.exit("User and/or group 'insights' not found. Exiting.") - -- sys.path = [STABLE_EGG, RPM_EGG] + sys.path -+ validated_eggs = filter(gpg_validate, [STABLE_EGG, RPM_EGG]) -+ -+ if not validated_eggs: -+ sys.exit("No GPG-verified eggs can be found") -+ -+ sys.path = validated_eggs + sys.path - - try: - # flake8 complains because these imports aren't at the top -+ import insights - from insights.client import InsightsClient - from insights.client.phase.v1 import get_phases - -@@ -124,6 +146,7 @@ def _main(): - log_handler.doRollover() - # we now have access to the clients logging mechanism instead of using print - client.set_up_logging() -+ logging.root.debug("Loaded initial egg: %s", os.path.dirname(insights.__file__)) - - # check for insights user/group - if not (insights_uid or insights_gid): --- -2.14.3 - diff --git a/SOURCES/0013-Bump-release-to-8.patch b/SOURCES/0013-Bump-release-to-8.patch deleted file mode 100644 index da4cc32..0000000 --- a/SOURCES/0013-Bump-release-to-8.patch +++ /dev/null @@ -1,22 +0,0 @@ -From f8fc07787591af5f4ccd1ed24cdef30b5871c799 Mon Sep 17 00:00:00 2001 -From: Kyle Lape -Date: Mon, 23 Feb 2018 13:05:00 -0600 -Subject: [PATCH] Bump release to 7 - ---- - insights_client/constants.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/insights_client/constants.py b/insights_client/constants.py -index 4e77354..4784e67 100644 ---- a/insights_client/constants.py -+++ b/insights_client/constants.py -@@ -5,4 +5,4 @@ Constants - - class InsightsConstants(object): - app_name = 'insights-client' -- version = '3.0.3-7' -+ version = '3.0.3-8' --- -2.14.3 - diff --git a/SOURCES/0014-Bump-release-to-9.patch b/SOURCES/0014-Bump-release-to-9.patch deleted file mode 100644 index e837b28..0000000 --- a/SOURCES/0014-Bump-release-to-9.patch +++ /dev/null @@ -1,22 +0,0 @@ -From f8fc07787591af5f4ccd1ed24cdef30b5871c799 Mon Sep 17 00:00:00 2001 -From: Richard Brantley -Date: Wed, 14 Mar 2018 10:20:00 -0400 -Subject: [PATCH] Bump release to 9 - ---- - insights_client/constants.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/insights_client/constants.py b/insights_client/constants.py -index 4e77354..4784e67 100644 ---- a/insights_client/constants.py -+++ b/insights_client/constants.py -@@ -5,4 +5,4 @@ Constants - - class InsightsConstants(object): - app_name = 'insights-client' -- version = '3.0.3-8' -+ version = '3.0.3-9' --- -2.14.3 - diff --git a/SPECS/insights-client.spec b/SPECS/insights-client.spec index ba2e37b..0edacc8 100644 --- a/SPECS/insights-client.spec +++ b/SPECS/insights-client.spec @@ -1,112 +1,79 @@ -%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %define _binaries_in_noarch_packages_terminate_build 0 -%global insights_user insights -%global insights_group %{insights_user} - Name: insights-client Summary: Uploads Insights information to Red Hat on a periodic basis -Version: 3.0.3 -Release: 9%{?dist} +Version: 3.0.6 +Release: 2%{?dist} Source0: https://github.com/redhatinsights/insights-client/archive/insights-client-%{version}.tar.gz Epoch: 0 License: GPLv2+ -URL: http://access.redhat.com/insights +URL: http://cloud.redhat.com/insights Group: Applications/System Vendor: Red Hat, Inc. Provides: redhat-access-insights = 1.0.13-3 -Provides: redhat-access-insights = %{version}-%{release} +Provides: redhat-access-insights = %{version}-%{release}%{?dist} + +Obsoletes: redhat-access-insights +Obsoletes: redhat-access-proactive -Obsoletes: redhat-access-insights <= 1.0.13-2%{?dist} -Obsoletes: redhat-access-proactive <= 0.3.3-0%{?dist} +Requires: tar +Requires: gpg +Requires: pciutils +BuildArch: noarch +# RHEL 8 +%if 0%{?rhel} == 8 +%{?__python3:Requires: %{__python3}} +Requires: platform-python-setuptools +Requires: python3-requests >= 2.6 +Requires: python3-PyYAML +Requires: python3-pyOpenSSL +Requires: python3-magic +Requires: python3-six +BuildRequires: python3-devel +BuildRequires: python3-setuptools + +# RHEL 6-7 +%else Requires: python Requires: python-setuptools Requires: python-requests >= 2.6 Requires: PyYAML Requires: pyOpenSSL Requires: libcgroup -Requires: tar -Requires: gpg -Requires: pciutils Requires: python-magic -Requires: python-six -%if 0%{?rhel} && 0%{?rhel} == 6 +Requires: python-six >= 1.9.0 +BuildRequires: python2-devel +BuildRequires: python-setuptools +%endif + +# systemd/RHEL 6 deps +%if 0%{?rhel} == 6 Requires: python-argparse %else %{?systemd_requires} Requires: systemd -%endif -BuildArch: noarch - -# git is need for '%%autosetup -S git' which automatically applies all the -# patches above. Please, be aware that the patches must be generated -# by 'git format-patch' -BuildRequires: git - -BuildRequires: findutils -BuildRequires: zip -BuildRequires: unzip -BuildRequires: python2-devel -BuildRequires: python-setuptools -%if 0%{?rhel} != 6 BuildRequires: systemd %endif -Patch1: 0001-Bump-release.patch -Patch2: 0002-Bump-release-again.patch -Patch3: 0003-Bump-release-to-4.patch -Patch4: 0004-Scheduling-should-enable-disable-systemd-timer.patch -Patch5: 0005-Bump-egg-release-to-3.patch -Patch6: 0006-Bump-release-to-5.patch -Patch7: 0007-Removing-magic.py.patch -Patch8: 0008-Resolving-differences-between-build-metadata.patch -Patch9: 0009-Bump-release-to-6.patch -Patch10: 0010-Updating-egg-signature.patch -Patch11: 0011-Bump-release-to-7.patch -Patch12: 0012-GPG-verify-egg-in-parent-process.patch -Patch13: 0013-Bump-release-to-8.patch -Patch14: 0014-Bump-release-to-9.patch - %description Sends insightful information to Red Hat for automated analysis %prep -# http://www.rpm.org/wiki/PackagerDocs/Autosetup -# Default '__scm_apply_git' is 'git apply && git commit' but this workflow -# doesn't allow us to create a new file within a patch, so we have to use -# 'git am' (see /usr/lib/rpm/macros for more details) -%define __scm_apply_git(qp:m:) %{__git} am - -%autosetup -S git -N -%_bindir/unzip etc/rpm.egg -d egg -git add egg -git commit -q -m "Add unzipped egg" -%autopatch -cd egg -# Hard coding the timestamps makes the rpm reproducible bit-for-bit (needed for -# signing). --no-dir-entries is also necessary. This archive is never -# unzipped by insights. -%_bindir/rm -f ../etc/rpm.egg -%_bindir/find . -type f -exec touch -c -t 201801010000.00 {} \; -%_bindir/find . -type f -exec chmod 0444 {} \; -%_bindir/find . -type f -print | %_bindir/sort -df | %_bindir/xargs %_bindir/zip -X --no-dir-entries -r ../etc/rpm.egg -cd .. -%_bindir/git rm -rf egg -%_bindir/git commit -q -m "Remove unzipped egg" -%_bindir/git add etc/rpm.egg -%_bindir/git commit -q -m "Update egg" +%setup -q %install rm -rf ${RPM_BUILD_ROOT} -%{__python} setup.py install --root=${RPM_BUILD_ROOT} $PREFIX - -%pre -getent group insights > /dev/null || /usr/sbin/groupadd -r %{insights_group} -getent passwd insights > /dev/null || \ - /usr/sbin/useradd -g insights -r --shell /sbin/nologin %{insights_user} \ - -c "Red Hat Insights" -d /var/lib/insights +%if 0%{?rhel} == 8 +%{__python3} setup.py install --root=${RPM_BUILD_ROOT} $PREFIX +pathfix.py -pni "%{__python3}" %{buildroot}%{python3_sitelib}/insights_client/{__init__.py,major_version.py,run.py} +pathfix.py -pni "%{__python3}" %{buildroot}%{_bindir}/insights-client-run +pathfix.py -pni "%{__python3}" %{buildroot}%{_bindir}/insights-client +pathfix.py -pni "%{__python3}" %{buildroot}%{_bindir}/redhat-access-insights +%else +%{__python2} setup.py install --root=${RPM_BUILD_ROOT} $PREFIX +%endif %post @@ -140,72 +107,34 @@ if [ $1 -eq 1 ]; then if [ -f "/etc/redhat-access-insights/.lastupload" ]; then cp /etc/redhat-access-insights/.lastupload /etc/insights-client/.lastupload fi + #Migrate remove.conf + if [ -f "/etc/redhat-access-insights/remove.conf" ]; then + cp /etc/redhat-access-insights/remove.conf /etc/insights-client/remove.conf + fi if ! [ -d "/etc/redhat-access-insights" ]; then mkdir /etc/redhat-access-insights fi # Symlink new cron job if the old one exists. Remove the old one if [ -f "/etc/cron.daily/redhat-access-insights" ]; then rm -f /etc/cron.daily/redhat-access-insights - %if 0%{?rhel} && 0%{?rhel} == 6 + %if 0%{?rhel} == 6 ln -sf /etc/insights-client/insights-client.cron /etc/cron.daily/insights-client %else %_bindir/systemctl start insights-client.timer - %_bindir/systemctl enable insights-client.timer %endif - else - # Need to handle RHEL 7.5 GA where timer was started but disabled - # Enable timer if it's currently started but disabled - if %_bindir/systemctl status insights-client.timer > /dev/null; then - if ! %_bindir/systemctl is-enabled insights-client.timer > /dev/null; then - %_bindir/systemctl enable insights-client.timer > /dev/null - fi - fi fi fi # if the logging directory isnt created then make it -# and set the ACLs if ! [ -d "/var/log/insights-client" ]; then -mkdir /var/log/insights-client +mkdir -m 640 /var/log/insights-client fi -setfacl -Rd -m g:insights:rwX /var/log/insights-client -setfacl -m g:insights:rwX /var/log/insights-client # if the library directory for eggs and such isn't present -# make it AND -# set the ACLs +# make it if ! [ -d "/var/lib/insights" ]; then -mkdir /var/lib/insights -fi -setfacl -Rd -m g:insights:rwX /var/lib/insights -setfacl -R -m g:insights:rwX /var/lib/insights - -# set some more ACLs -setfacl -Rd -m g:insights:rwX -m m:rw /etc/insights-client -setfacl -R -m g:insights:rwX -m m:rw /etc/insights-client -setfacl -m g:insights:r -m m:r /etc/insights-client/*.pem -setfacl -m g:insights:r -m m:r /etc/insights-client/redhattools.pub.gpg -setfacl -m g:insights:rw -m m:rw /etc/insights-client/insights-client.conf -setfacl -m g:insights:r -m m:r /etc/insights-client/rpm.egg -setfacl -m g:insights:r -m m:r /etc/insights-client/rpm.egg.asc -setfacl -m g:insights:rwx /etc/insights-client - -# if ansible is present -# make the fact directory AND -# the fact file AND -# set the ACLs -if [ -d "/etc/ansible" ]; then -if ! [ -d "/etc/ansible/facts.d" ]; then -mkdir /etc/ansible/facts.d -fi +mkdir -m 644 /var/lib/insights fi -if [ -d "/etc/ansible/facts.d" ]; then -touch /etc/ansible/facts.d/insights.fact -touch /etc/ansible/facts.d/insights_machine_id.fact -setfacl -m g:insights:rw /etc/ansible/facts.d/insights.fact -setfacl -m g:insights:rw /etc/ansible/facts.d/insights_machine_id.fact -fi - # always perform legacy symlinks %posttrans @@ -216,15 +145,10 @@ ln -sf /etc/insights-client/.registered /etc/redhat-access-insights/.registered ln -sf /etc/insights-client/.unregistered /etc/redhat-access-insights/.unregistered ln -sf /etc/insights-client/.lastupload /etc/redhat-access-insights/.lastupload ln -sf /etc/insights-client/machine-id /etc/redhat-access-insights/machine-id -if [ -f "/etc/insights-client/.lastupload" ]; then - setfacl -m g:insights:rwx /etc/insights-client/.lastupload -fi -if [ -f "/etc/insights-client/.registered" ]; then - setfacl -m g:insights:rwx /etc/insights-client/.registered -fi -if [ -f "/etc/insights-client/.unregistered" ]; then - setfacl -m g:insights:rwx /etc/insights-client/.unregistered -fi +# remove all ACLs on upgrade, forever and always +setfacl -Rb /var/lib/insights +setfacl -Rb /var/log/insights-client +setfacl -Rb /etc/insights-client %preun %if 0%{?rhel} != 6 @@ -246,7 +170,9 @@ rm -f /etc/insights-client/.unregistered rm -f /etc/insights-client/.lastupload rm -f /etc/insights-client/rpm.egg rm -f /etc/insights-client/rpm.egg.asc +rm -f /etc/insights-client/.insights-core*.etag rm -rf /var/lib/insights +# keep these to remove from previous install rm -f /etc/ansible/facts.d/insights.fact rm -f /etc/ansible/facts.d/insights_machine_id.fact # remove symlink to old name on uninstall @@ -279,16 +205,26 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{_bindir}/redhat-access-insights %attr(755,root,root) %{_bindir}/insights-client-run -%if 0%{?rhel} && 0%{?rhel} == 6 +%if 0%{?rhel} == 6 %attr(755,root,root) /etc/insights-client/insights-client.cron %endif %attr(644,root,root) /etc/insights-client/rpm.egg %attr(644,root,root) /etc/insights-client/rpm.egg.asc -%attr(755,root,root) %dir %{python_sitelib}/insights_client*.egg-info -%attr(644,root,root) %{python_sitelib}/insights_client*.egg-info/* -%attr(644,root,root) %{python_sitelib}/insights_client/*.py* +%if 0%{?rhel} == 8 +%attr(755,root,root) %dir %{python3_sitelib}/insights_client*.egg-info +%attr(644,root,root) %{python3_sitelib}/insights_client*.egg-info/* +%attr(644,root,root) %{python3_sitelib}/insights_client/*.py* +%attr(644,root,root) %{python3_sitelib}/insights_client/__pycache__ +%else +%attr(755,root,root) %dir %{python2_sitelib}/insights_client*.egg-info +%attr(644,root,root) %{python2_sitelib}/insights_client*.egg-info/* +%attr(644,root,root) %{python2_sitelib}/insights_client/*.py* +%endif + +%attr(640,root,root) /var/log/insights-client +%attr(644,root,root) /var/lib/insights %doc %defattr(-, root, root) @@ -296,6 +232,12 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT /usr/share/man/man5/*.5.gz %changelog +* Wed Jul 10 2019 Jeremy Crafts - 3.0.6-0 +- Optimize specfile for RHEL 6, 7, 8 compatibility +- Update service URL +- Remove ACLs and insights user from installation +- Resolves: BZ1730796, BZ1730797, BZ1730798, BZ1730799, BZ1730800, BZ1730801 + * Wed Mar 14 2018 Richard Brantley - 3.0.3-8 - Resolves: rhbz#1555041