From 0df4b3f44cb6abf1bf7ca5fb90eea22d8f1ef37f Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 10 2018 05:51:49 +0000 Subject: import insights-client-3.0.3-8.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6c177b4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/insights-client-3.0.3.tar.gz diff --git a/.insights-client.metadata b/.insights-client.metadata new file mode 100644 index 0000000..9685f1c --- /dev/null +++ b/.insights-client.metadata @@ -0,0 +1 @@ +6314d8d2eb1c7f687cbfc74852ff8e2ac0af2ed2 SOURCES/insights-client-3.0.3.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/0001-Bump-release.patch b/SOURCES/0001-Bump-release.patch new file mode 100644 index 0000000..c742fbc --- /dev/null +++ b/SOURCES/0001-Bump-release.patch @@ -0,0 +1,22 @@ +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 new file mode 100644 index 0000000..2fec980 --- /dev/null +++ b/SOURCES/0002-Bump-release-again.patch @@ -0,0 +1,22 @@ +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 new file mode 100644 index 0000000..d12c831 --- /dev/null +++ b/SOURCES/0003-Bump-release-to-4.patch @@ -0,0 +1,22 @@ +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 new file mode 100644 index 0000000..698f31e --- /dev/null +++ b/SOURCES/0004-Scheduling-should-enable-disable-systemd-timer.patch @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..6911ecc --- /dev/null +++ b/SOURCES/0005-Bump-egg-release-to-3.patch @@ -0,0 +1,19 @@ +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 new file mode 100644 index 0000000..a5d9a43 --- /dev/null +++ b/SOURCES/0006-Bump-release-to-5.patch @@ -0,0 +1,22 @@ +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 new file mode 100644 index 0000000..d448eba --- /dev/null +++ b/SOURCES/0007-Removing-magic.py.patch @@ -0,0 +1,227 @@ +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 new file mode 100644 index 0000000..2ecf60a --- /dev/null +++ b/SOURCES/0008-Resolving-differences-between-build-metadata.patch @@ -0,0 +1,47 @@ +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 new file mode 100644 index 0000000..bde1ab2 --- /dev/null +++ b/SOURCES/0009-Bump-release-to-6.patch @@ -0,0 +1,22 @@ +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 new file mode 100644 index 0000000..1505346 --- /dev/null +++ b/SOURCES/0010-Updating-egg-signature.patch @@ -0,0 +1,47 @@ +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 new file mode 100644 index 0000000..376ca08 --- /dev/null +++ b/SOURCES/0011-Bump-release-to-7.patch @@ -0,0 +1,22 @@ +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 new file mode 100644 index 0000000..2b8f398 --- /dev/null +++ b/SOURCES/0012-GPG-verify-egg-in-parent-process.patch @@ -0,0 +1,91 @@ +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 new file mode 100644 index 0000000..da4cc32 --- /dev/null +++ b/SOURCES/0013-Bump-release-to-8.patch @@ -0,0 +1,22 @@ +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/SPECS/insights-client.spec b/SPECS/insights-client.spec new file mode 100644 index 0000000..9a1fc26 --- /dev/null +++ b/SPECS/insights-client.spec @@ -0,0 +1,317 @@ +%{!?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: 8%{?dist} +Source0: https://github.com/redhatinsights/insights-client/archive/insights-client-%{version}.tar.gz +Epoch: 0 +License: GPLv2+ +URL: http://access.redhat.com/insights +Group: Applications/System +Vendor: Red Hat, Inc. + +Provides: redhat-access-insights = 1.0.13-3 +Provides: redhat-access-insights = %{version}-%{release} + +Obsoletes: redhat-access-insights <= 1.0.13-2%{?dist} +Obsoletes: redhat-access-proactive <= 0.3.3-0%{?dist} + +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-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 + +%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" + +%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 + +%post + +%if 0%{?rhel} != 6 +%systemd_post %{name}.timer +%endif + +# Only perform migration from redhat-access-insights to insights-client +if [ $1 -eq 1 ]; then + #Migrate existing machine-id + if [ -f "/etc/redhat_access_proactive/machine-id" ]; then + cp /etc/redhat_access_proactive/machine-id /etc/insights-client/machine-id + fi + #Migrate OTHER existing machine-id + if [ -f "/etc/redhat-access-insights/machine-id" ]; then + cp /etc/redhat-access-insights/machine-id /etc/insights-client/machine-id + fi + #Migrate existing config + if [ -f "/etc/redhat-access-insights/redhat-access-insights.conf" ]; then + cp /etc/redhat-access-insights/redhat-access-insights.conf /etc/insights-client/insights-client.conf + sed -i 's/\[redhat-access-insights\]/\[insights-client\]/' /etc/insights-client/insights-client.conf + fi + #Migrate registration record + if [ -f "/etc/redhat-access-insights/.registered" ]; then + cp /etc/redhat-access-insights/.registered /etc/insights-client/.registered + fi + if [ -f "/etc/redhat-access-insights/.unregistered" ]; then + cp /etc/redhat-access-insights/.unregistered /etc/insights-client/.unregistered + fi + #Migrate last upload record + if [ -f "/etc/redhat-access-insights/.lastupload" ]; then + cp /etc/redhat-access-insights/.lastupload /etc/insights-client/.lastupload + 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 + ln -sf /etc/insights-client/insights-client.cron /etc/cron.daily/insights-client + %else + %_bindir/systemctl start insights-client.timer + %endif + 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 +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 +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 +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 +mkdir -p /etc/redhat-access-insights +ln -sf /etc/insights-client/insights-client.conf /etc/redhat-access-insights/redhat-access-insights.conf +ln -sf /etc/insights-client/insights-client.cron /etc/redhat-access-insights/redhat-access-insights.cron +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 + +%preun +%if 0%{?rhel} != 6 +%systemd_preun %{name}.timer +%systemd_preun %{name}.service +%endif + +%postun +if [ "$1" -eq 0 ]; then +# One run on removal, not upgrade +%if 0%{?rhel} != 6 +%_bindir/systemctl daemon-reload > /dev/null 2>&1 +%endif +rm -f /etc/cron.daily/insights-client +rm -f /etc/cron.weekly/insights-client +rm -f /etc/insights-client/.cache* +rm -f /etc/insights-client/.registered +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 -rf /var/lib/insights +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 +rm -f %{_bindir}/redhat-access-insights +# remove symlinks to old configs +rm -rf /etc/redhat-access-insights/ +rm -f /etc/cron.daily/redhat-access-insights +rm -f /etc/cron.weekly/redhat-access-insights +fi + +%clean +test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT + +%files +%defattr(0600, root, root) +%config(noreplace) /etc/insights-client/*.conf +/etc/insights-client/.fallback.json +/etc/insights-client/.fallback.json.asc +/etc/insights-client/.exp.sed + +%if 0%{?rhel} != 6 +%attr(644,root,root) %{_unitdir}/insights-client.service +%attr(644,root,root) %{_unitdir}/insights-client.timer +%endif + +%attr(440,root,root) /etc/insights-client/*.pem +%attr(440,root,root) /etc/insights-client/redhattools.pub.gpg + +%attr(755,root,root) %{_bindir}/insights-client +%attr(755,root,root) %{_bindir}/redhat-access-insights +%attr(755,root,root) %{_bindir}/insights-client-run + +%if 0%{?rhel} && 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* + +%doc +%defattr(-, root, root) +/usr/share/man/man8/*.8.gz +/usr/share/man/man5/*.5.gz + +%changelog +* Fri Feb 16 2018 Kyle Lape - 3.0.3-6 +- Persist systemd timer config between reboots + +* Wed Feb 7 2018 Kyle Lape - 3.0.3-2 +- Correct the version strings in Obsoletes and Provides in RPM spec + +* Thu Jan 18 2018 Kyle Lape - 3.0.3-1 +- RHEL 7 RPM now uses systemd service and timer instead of cron +- Addition of IO and CPU cgroup constraints +- Fixed memory cgroup constraint + +* Wed Oct 18 2017 Richard Brantley - 3.0.2-2 +- Resolves BZ1498650, BZ1500008, BZ1501545, BZ1501552, BZ1501556, BZ1501561, BZ1501565, BZ1501566 +- Fixes version migration logic +- Fixes symlink issues to old binary +- Fixes short ID analysis for images and containers +- Fixes Docker library detection +- Fixes image and container detection +- Fixes registration execution flow +- Fixes --version flag to print to stdout and include additional versioning information +- Includes Insights Core 3.0.3-1 + +* Wed Oct 4 2017 Richard Brantley - 3.0.1-5 +- Resolves BZ1498581 +- Fixes sys.path issues +- Includes Insights Core 3.0.2-6 + +* Wed Sep 27 2017 Richard Brantley - 3.0.0-4 +- Initial build