Giter Club home page Giter Club logo

scc-tools's Introduction

scc-tools

A set of simple tools to interact with SUSE Customer Center (SCC).

It basically uses the APIs available at https://scc.suse.com/api/package_search/v4/documentation

build result

vercheck

This tool searches for the latest versions of packages on SCC.

It started as a pet project to do a simple package search with the API, but it evolved into a much more complex tool that can analyze supportconfig archives, correlate product versions and repositories, and generate reports on package versions.

Disclaimer: I'm a SUSE employee.

Usage:

# ./vercheck.py [-l|--list-products] -p|--product product id -n|--name <package name> [-s|--short] [-v|--verbose] [-1|--show-unknown] [-2|--show-differences] [-3|--show-uptodate] [-4|--show-unsupported] [-5|--show-suseorphans] [-6|--show-suseptf] [-o|--outputdir] [-d|--supportconfig] [-a|--arch] [-f|--force-refresh] [-V|--version]

It uses compression, and a single urllib3 pool instance, to minimize the impact on the public server as much as possible. In order to speed things up, I open multiple threads and consume the RPM list slowly. I also tried to use all resources that do NOT require authentication, inspired by the public package search at https://scc.suse.com/packages . That is why I opted to use a static product list inside the code (which doesn't really change that often).

Vercheck has an internal cache. This was made in order to sidestep current rate-limiting issues on the SCC API servers (issue #22).

This is how it works:

  1. a JSON file (scc_data.json) is created/updated to hold cache entries, either in /var/cache/scc-tools or ~/.cache/scc-tools. The directory is selected based on whether it can write to each location, in order of preference.

  2. the cache currently holds entries for 5 days. This guarantees that fresh information can be retrieved in a reasonable timeframe if necessary. Here's an example of an entry being dropped and immediately being queued for a refresh:

cached data for zypper is too old (-6 days), discarding cache entry
removing record from cache: {'id': 21851832, 'name': 'zypper', 'arch': 'x86_64', 'version': '1.14.51', 'release': '3.52.1', 'products': [{'id': 2219, 'name': 'SUSE Linux Enterprise Server LTSS', 'identifier': 'SLES-LTSS/15.1/x86_64', 'type': 'extension', 'free': False, 'edition': '15 SP1', 'architecture': 'x86_64'}], 'timestamp': '2022-03-12T02:15:30.193223', 'repository': 'Basesystem Module 15 SP2 x86_6415 SP2x86_64', 'product_id': 1939}
searching for zypper for product ID 1939 in SCC
  1. the same cache mechanism is implemented for Public Cloud images, using data from SUSE PINT (pint.suse.com). In this case, the information about active/inactive/deprecated/deleted images are kept for 7 days, and automatically refreshed upon running.

  2. it also contains an internal table correlating each product to modules (taken from RMT). This is necessary in order to maintain cache consistency, as sometimes a suitable updated package resides in a different module repository, and we need to know what was the original product ID in order to return the correct cache entry.

  3. there is an additional command-line option:

-f|--force-refresh              Ignore cached data and retrieve latest data from SCC and public cloud info

This ignores the cache and goes straight to SCC for the latest data (the results are added to the cache at the end for later use though).

  1. it's also heavily multi-threaded, and as such it has a way more complex data locking logic.

IMPORTANT: as we discovered through testing, running multiple parallel copies of this version may "lose" some of the recently refreshed cache entries. This limitation is by design. What happens is that in every session I read the cached entries to memory, then write it all at the end. Everything is changed in-memory. So, whoever runs last "wins". This is to avoid thousands of small disk writes, and possibly being called a "disk killer" :-) In the future I intend to implement a more robust cache backend (sqlite?) and address this. I might also merge it back to a single version of the script.

Examples

  • Listing supported products list (-l or --list):
$  ./vercheck.py -l
Known products list
ID      Name
-----------------------------------------------------
1117    SUSE Linux Enterprise Server 12 x86_64
1322    SUSE Linux Enterprise Server 12 SP1 x86_64
1357    SUSE Linux Enterprise Server 12 SP2 x86_64
1421    SUSE Linux Enterprise Server 12 SP3 x86_64
1625    SUSE Linux Enterprise Server 12 SP4 x86_64
1878    SUSE Linux Enterprise Server 12 SP5 x86_64
1319    SUSE Linux Enterprise Server for SAP 12 x86_64
1346    SUSE Linux Enterprise Server for SAP 12 SP1 x86_64
1414    SUSE Linux Enterprise Server for SAP 12 SP2 x86_64
1426    SUSE Linux Enterprise Server for SAP 12 SP3 x86_64
1755    SUSE Linux Enterprise Server for SAP 12 SP4 x86_64
1880    SUSE Linux Enterprise Server for SAP 12 SP5 x86_64
1575    SUSE Linux Enterprise Server 15 x86_64
1763    SUSE Linux Enterprise Server 15 SP1 x86_64
1939    SUSE Linux Enterprise Server 15 SP2 x86_64
...

As of Oct 2023, 103 products are supported.

Note: SLE 11 and derivatives are not supported for queries by the API, even though there are valid product numbers for it.

  • Checking for the latest version of the package "glibc" for product 2465 (SLES 15 SP5 x86_64), verbose mode:
$ ./vercheck.py -p 2465 -n glibc -v
Using product ID 2465 (SUSE Linux Enterprise Server 15 SP5 x86_64)
searching for package "glibc" in product id "2465" (SUSE Linux Enterprise Server 15 SP5 x86_64)
found glibc for product ID 2465 (cached)
latest version for glibc on product ID 2465(SUSE Linux Enterprise Server 15 SP5 x86_64) is 2.31-150300.46.1, found on Basesystem Module (sle-module-basesystem/15.5/x86_64)
version 2.31-150300.46.1 is available on repository [Basesystem Module 15 SP5 x86_64 15 SP5 x86_64]

Note that it correctly treats second- and third-order release numbers, and sorts them accordingly to get the latest version.

  • Checking for the latest version of the package "glibc" for product 2465 (SLES 15 SP5 x86_64), short answer:
$ ./vercheck.py -p 2465 -n glibc -s
searching for package "glibc" in product id "2465" (SUSE Linux Enterprise Server 15 SP5 x86_64)
searching for glibc for product ID 2465 in SCC
2.31-150300.63.1

  • Analyzing a supportconfig
$ ./vercheck.py -d tests/SLE15SP5/scc_rmt_231027_1743
loaded 2628 items from cache (/home/erico/.cache/scc-tools/scc_data.json)
loaded 5 items from cache (/home/erico/.cache/scc-tools/public_cloud_amazon.json)
* cached data OK (-4 days old)
loaded 5 items from cache (/home/erico/.cache/scc-tools/public_cloud_google.json)
* cached data OK (-4 days old)
loaded 5 items from cache (/home/erico/.cache/scc-tools/public_cloud_microsoft.json)
* cached data OK (-4 days old)
--- AMAZON data as of 2023-10-27T17:24:07.180514
* 1468 active images
* 942 inactive images
* 9060 deprecated images
* 14763 deleted images

--- MICROSOFT data as of 2023-10-27T17:24:07.180514
* 187 active images
* 147 inactive images
* 548 deprecated images
* 4543 deleted images

--- GOOGLE data as of 2023-10-27T17:24:07.180514
* 33 active images
* 26 inactive images
* 106 deprecated images
* 708 deleted images

--> Public cloud provider for tests/SLE15SP5/scc_rmt_231027_1743 is [none]
--> not a public cloud image, continuing normal analysis
Analyzing supportconfig directory: tests/SLE15SP5/scc_rmt_231027_1743
product name = SUSE Linux Enterprise Server 15 SP5 x86_64 (id 2465, x86_64)
found 986 total packages to check
found Mesa-dri for product ID 2465 (cached)
found Mesa for product ID 2465 (cached)
found Mesa-gallium for product ID 2465 (cached)
found Mesa-libEGL1 for product ID 2465 (cached)
found Mesa-libGL1 for product ID 2465 (cached)
found Mesa-libglapi0 for product ID 2465 (cached)
...
thread search-yast2-ycp-ui-bindings is done
thread search-zisofs-tools is done
thread search-zstd is done
thread search-zypper is done
thread search-zypper-lifecycle-plugin is done
thread search-zypper-log is done
thread search-zypper-needs-restarting is done

Done.
writing CSV reports to /home/erico/Projetos/scc-tools


This option analyzes a previously extracted supportconfig report. It will find the installed RPMs in the report, and run searches on ALL packages in order to find which ones are up-to-date, have older versions, or are not found in the official repositories. Packages that are from unsupported vendors also get their own report. Packages that are orphans (as in, packages that belong to another version of the OS and were left installed) and PTF (Program Temporary Fix) packages built by SUSE also have a separate report.

It generates 6 CSV reports: vercheck-uptodate-[directory name].csv, vercheck-different-[directory name].csv, vercheck-notfound-[directory name].csv, vercheck-unsupported-[directory name].csv, vercheck-suseorphans-[directory name].csv, and vercheck-suseptf-[directory name].csv respectively.

An output directory can be specified by adding the "-o" (or --outputdir) parameter before the supportconfig directory:

 ./vercheck.py -o /tmp/reports -d ~/Documents/nts_dxl1lnxsl002_200616_1148 
  • Final considerations

This utility only uses public resources maintained by SUSE LLC, no logins are necessary. I make no guarantees on availability or speed. I try to make sure that the information mined by vercheck is as accurate as possible, but errors can occur.

If you find a bug or inconsistency, please open an issue!

scc-tools's People

Contributors

doccaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

mugru jhhudso

scc-tools's Issues

Handling of SUSE Manager Clients RPMs

I consider this more an enhancement than a bug.

Can you either

  • exclude RPMs that belong to the SUSE Manger Bootstrap repo or
  • always fetch SUSE Manager repo on top

Some packages that vercheck claims to be "unsupported" ;-)

sle-manager-tools-release | SUSE Linux Enterprise 12 | 12-10.3.1
sle-manager-tools-release-POOL | SUSE Linux Enterprise 12 | 12-1.20
python2-rhnlib | SUSE Linux Enterprise 12 | 4.3.4-21.43.3
spacewalk-usix | SUSE Linux Enterprise 12 | 4.0.9-3.6.7
supportutils-plugin-salt | SUSE Linux Enterprise 12 | 1.2.0-6.16.1

sle-manager-tools-release | SUSE Linux Enterprise 15 | 15-113.8.1

Add CLI to query public image database

Since we already download and manage local cached copies of the PINT databases, we should implement parameters/commands to query it on the CLI. It should be a quicker alternative to checking the PINT website.

Python 3.4 needs explicit json encoding

Hi,

according to https://docs.python.org/3/library/json.html#json.loads needs explicit encoding on older Python 3:
Changed in version 3.6: s can now be of type bytes or bytearray. The input encoding should be UTF-8, UTF-16 or UTF-32.

We applied this to get it working internally:

--- vercheck.py.old     2021-08-30 13:55:05.124482403 +0200
+++ vercheck.py 2021-08-30 13:15:28.445376243 +0200
@@ -478,11 +478,11 @@
                        if r.status == 200:
                                if tries > 0:
                                        print('thread %d got a good reply after %d tries' % (self.instance_nr, tries))
-                               return_data = json.loads(r.data)
+                               return_data = json.loads(r.data.decode('utf-8'))
                                valid_response = True
                        elif r.status in self.error_states:
                                if r.data:
-                                       json_data = json.loads(r.data)
+                                       json_data = json.loads(r.data.decode('utf-8'))
                                        print('cannot be processed due to error: [' + json_data['error'] + ']')
                                print('thread %d got a fatal error (%d). Results will be incomplete!\nPlease contact the service administrators or try again later.' % (self.instance_nr, r.status))
                                break

ata['data'] invalid syntax

(11:22 jchandler@concord ~) > vercheck.py 
  File "/storage/tools/vercheck.py", line 438
    ata['data']:
               ^
SyntaxError: invalid syntax

limit messages during supportconfig check

Do not emit the package versions while analyzing a supportconfig by default. Instead, create flags to show specific messages.
e.g. --show-unknown, --show-differences, --show-uptodate.

Maybe show a spinner or just the package count while it works?

Add user-friendly reports

Instead of printing out matching types of packages as they're found, output a more easily-readable report.

Option -a is undocumented

could not determine architecture for the supportconfig directory. Please supply one with -a.

maybe -a x86_64 ???

Create a separate report for PTF packages

SUSE PTFs (Program Temporary Fix) packages have been standardized to have a specific "vendor" tag. They've been erroneously categorized as "unsupported" and went to the wrong list.

I'm implementing an extra report/CSV file where they can live, called "suseptf".

Implement a --version parameter

A colleague asked for adding a --version parameter. This is a bit tricky when dealing with GIT, unless I start using proper release tags and using git archive to do so. Even so, it seems things are a wee bit more complicated to have something like the old "$Id$" string in other version control systems.

vercheck-cache hitting 100% CPU when threads are idle

After yet another severe rate-limiting event from the API server, we found a situation where dozens of threads were waiting on the results from the server for hours, and the vercheck process hit a solid 100% CPU until it was killed.

Apparently, Python threading doesn't yield idle time back to the CPU properly. Will have to research that, or maybe go for the multiprocessing library as an alternative.

Avoid generating reports for SLES 11 servers

If vercheck is run against a supportconfig file for a SLE11 system, zero-length report files are written. It should not generate these files as SCC does not support SLE11 queries.

Bulk of messages

When trying to analyze the supportconfig report dir (vercheck-nocache.py -d scc...) appear bulk of messages:
/vercheck-nocache.py:638: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. return LooseVersion(v + '-' + r)
/vercheck-nocache.py:638: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. return LooseVersion(v + '-' + r)
/vercheck-nocache.py:638: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. return LooseVersion(v + '-' + r)
/vercheck-nocache.py:638: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. return LooseVersion(v + '-' + r)
/vercheck-nocache.py:638: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. return LooseVersion(v + '-' + r)
/vercheck-nocache.py:638: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. return LooseVersion(v + '-' + r)
/vercheck-nocache.py:638: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. return LooseVersion(v + '-' + r)
/vercheck-nocache.py:638: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. return LooseVersion(v + '-' + r)
/vercheck-nocache.py:638: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. return LooseVersion(v + '-' + r)
/vercheck-nocache.py:638: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. return LooseVersion(v + '-' + r)
/vercheck-nocache.py:638: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. return LooseVersion(v + '-' + r)

CSV files being written without the archive name

As reported by Ralph Roth:

ralph at p5520 in ~/Documents/Eigene_TechDox/HealthCheck/scc-tools on master [?]
$ ll
total 128K
drwxr-xr-x 3 ralph users  193 25. Nov 16:41 ./
drwxr-xr-x 3 ralph users 4,0K 25. Nov 15:57 ../
drwxr-xr-x 8 ralph users  163 25. Nov 15:56 .git/
-rw-r--r-- 1 ralph users 1,1K 25. Nov 15:56 LICENSE
-rw-r--r-- 1 ralph users 6,6K 25. Nov 15:56 README.md
-rw-r--r-- 1 ralph users  18K 25. Nov 16:41 vercheck-different-.csv
-rw-r--r-- 1 ralph users 2,2K 25. Nov 16:41 vercheck-notfound-.csv
-rw-r--r-- 1 ralph users  448 25. Nov 16:41 vercheck-unsupported-.csv
-rw-r--r-- 1 ralph users  45K 25. Nov 16:41 vercheck-uptodate-.csv
-rwxr-xr-x 1 ralph users  34K 25. Nov 15:56 vercheck.py*

The script was called with:

$ ./vercheck.py -d /home/ralph/Desktop/.../unpacked/scc_czdcpv-uxnfs204_211101_1146/

Convert the CacheManager class to use SQLite

Due to the potential amount of small writes with multiple instances, the current cache implementation (plain JSON file) only reads the cache at the startup, modifies it in-memory, then writes it at the end. This is not optimal, and as a collateral effect "only the last one wins". With an SQLite backend, I hope to mitigate this.

Curiously, the current implementation has the thread locking working fine and there have been no data corruptions, but SQLite would also help with that too.

Older version returned instead of the latest one ๐Ÿ˜’

Analyzing scc_ccd03b001421_210922_1732, vercheck shows an older version of dbus1 than they have installed. Also looks like its displaying the shipping version instead of updates channel:

dbus-1,1.12.2-8.6.1,1.12.2-8.3.1,Basesystem Module 15 SP1 x86_64

I assume the versions reported by repositories that match the "base_regex" have more priority over the other repositories. However, it seems I forgot to check if the version is actually higher than the original version and discard it if otherwise.

possible issue in vercheck.py

I found following difference in the resulted logs


Analyzing supportconfig directory: scc_ABC-SGS-SP808_xxxxxx
product name = SUSE Linux Enterprise Server 15 SP1 x86_64 (id 1763, x86_64)
found 1171 total packages to check
gathering results...

Done.
writing CSV reports to scc_ABC-SGS-SP808_xxxxxx

notfound: gnome-desktop,2.28.2-0.6.18
different: gnome-desktop-lang,2.28.2-0.6.18,3.26.2-2.13

as package "gnome-desktop-lang" will be build as sub package of "gnome-desktop" i am pretty sure there is somewhere a error (probably parsing or program logic) hidden in vercheck.py

the affected packages according to rpm.txt

gnome-desktop SUSE Linux Enterprise 11 2.28.2-0.6.18
gnome-desktop-lang SUSE Linux Enterprise 11 2.28.2-0.6.18

probably they are leftovers from a upgrade from SLES11 to SLES15

error comparing: 2.35-7.11.1 and 2.35.1-7.18.1

e20ca18 May have broken some of the comparing, wasn't seeing these before hand.

> vercheck.py -d.
Analyzing supportconfig directory: .
product name = SUSE Linux Enterprise Server 15 SP2 x86_64 (id 1939, x86_64)
found 838 total packages to check
gathering results...    
error comparing: 2.35-7.11.1 and 2.35.1-7.18.1 ([2, 35, '-', 7, 11, 1] and [2, 35, 1, '-', 7, 18, 1])
error comparing: 2.35-7.11.1 and 2.35.1-7.18.1 ([2, 35, '-', 7, 11, 1] and [2, 35, 1, '-', 7, 18, 1])
error comparing: 2.35-7.11.1 and 2.35.1-7.18.1 ([2, 35, '-', 7, 11, 1] and [2, 35, 1, '-', 7, 18, 1])
> grep -E '2.35.1-7.18.1|2.35-7.11.1' rpm.txt 
binutils                            SUSE Linux Enterprise 15            2.35.1-7.18.1
libctf-nobfd0                       SUSE Linux Enterprise 15            2.35.1-7.18.1
libctf0                             SUSE Linux Enterprise 15            2.35.1-7.18.1

Treat product IDs for SUSE Manager

I noticed that whenever processing supportconfig data from a SUSE Manager server, the susemanager-* are not found in the repositories. It turns out that I need to use the proper product ID when doing my queries, instead of the base system product ID.

I can determine the product version from the basic-environment.txt with a regex, and from there use the proper ID.

Start failed after "Downloading data for deleted images on amazon"

loaded 16277 items from cache (/home/user/.cache/scc-tools/scc_data.json)
loaded 5 items from cache (/home/user/.cache/scc-tools/public_cloud_amazon.json)

  • cached data for amazon is too old, downloading
    -- Downloading data for active images on amazon...
    -- Downloading data for inactive images on amazon...
    -- Downloading data for deprecated images on amazon...
    -- Downloading data for deleted images on amazon...
    got non-fatal reply (502) from server, trying again in 5 seconds
    got non-fatal reply (502) from server, trying again in 5 seconds
    got non-fatal reply (502) from server, trying again in 5 seconds
    got non-fatal reply (502) from server, trying again in 5 seconds
    got non-fatal reply (502) from server, trying again in 5 seconds
    Traceback (most recent call last):
    File "/home/user/Downloads/scc-tools/vercheck.py", line 2006, in
    main()
    File "/home/user/Downloads/scc-tools/vercheck.py", line 1435, in main
    pc = PublicCloudCheck()
    ^^^^^^^^^^^^^^^^^^
    File "/home/user/Downloads/scc-tools/vercheck.py", line 1794, in init
    self.aws_cm = PublicImageCacheManager(provider='amazon')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/user/Downloads/scc-tools/vercheck.py", line 1676, in init
    self.cache_data = self.get_image_states(provider)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/user/Downloads/scc-tools/vercheck.py", line 1778, in get_image_states
    image_data['deleted'] = self.fetch_image_states(provider, 'deleted')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/user/Downloads/scc-tools/vercheck.py", line 1769, in fetch_image_states
    return return_data['images']
    ~~~~~~~~~~~^^^^^^^^^^
    KeyError: 'images'

Handle 504 errors got error 504 from the server

Getting "got error 504 from the server" errors and noticed that the script just keeps going with new requests rather than retrying failed ones.
Adding handling for this could be helpful to prevent partial results

Single search is not updating the package cache

I noticed that single package searches are not updating the local JSON package cache, so for example:

# vercheck.py -p 2468 -n kernel-default
loaded 6532 items from cache (/home/erico/.cache/scc-tools/scc_data.json)
searching for package "kernel-default" in product id "2468" (SUSE Linux Enterprise Desktop 15 SP5 x86_64)
cached data for kernel-default is too old ( -134 days), discarding cache entry
searching for kernel-default for product ID 2468 in SCC
latest version for kernel-default on product ID 2468(SUSE Linux Enterprise Desktop 15 SP5 x86_64) is 5.14.21-150500.55.52.1, found on Basesystem Module (sle-module-basesystem/15.5/x86_64)

will always complain about the old cached data. The full directory analysis seems to update the cache correctly.

script taking too long to gather results

It's been reported that lately vercheck.py is taking around 10-12 minutes to complete, and is stuck in the "gathering results..." message for quite a while.

I've noticed that something changed in the SCC infrastructure that's leaving at least "max_threads" connections in the CLOSE_WAIT state until the kernel's tcp_fin_timeout runs out for each one. The default for recent kernels is 60 seconds.

Treat duplicate packages in PackageHub

As a collateral effect of issue #15 , packages that exist on both the main "Pool" repository and on PackageHub (with different versions!) now come up in the search results.

This leads to the wrong (?) package being selected as the latest version, like in this example for the package python3-hwdata on SUSE Manager 4.2:

2 packages with name containing "python3-hwdata" in SUSE Manager Server 4.2 x86_64
Name	Version	License	Module
python3-hwdata	2.3.5-bp153.1.13	GPL-2.0	SUSE Package Hub 15 SP3
python3-hwdata	2.3.5-1.21	GPL-2.0	SUSE Manager Server Module 4.2

The version comparison class will select 2.3.5-bp153.1.13 over 2.3.5-1.21. Still considering what to do in this case.

Add the release date of package

Seeing the release date of the package would be important to see at least for me. For instance, I wanted to see if a new version of suse-migration-sle15-activation was released but while I see the version number, I then need to go into the SCC to find out the release date.

โฏ vercheck.py -v -p 1755 -n suse-migration-sle15-activation
Using product ID 1755 (SUSE Linux Enterprise Server for SAP 12 SP4 x86_64)
looking for suse-migration-sle15-activation on product id 1755
version 1.2.0-6.8.1 is available on repository [Public Cloud Module 12 x86_64]
version 1.2.0-6.5.1 is available on repository [Public Cloud Module 12 x86_64]
version 1.2.0-6.11.3 is available on repository [Public Cloud Module 12 x86_64]
latest version for suse-migration-sle15-activation is 1.2.0-6.11.3

SLES for SAP identification issues

There is a TID (https://www.suse.com/support/kb/doc/?id=000019341) that describes os-release inconsistencies that were found on SLES for SAP. Basically, different CPE string schemes were used on each release.

Coincidentally, my table of product IDs in the code matches all the flavors up until SLES for SAP 12 SP4, but according to the TID, it can still be misleading and we should not rely on just the os-release information, but also check the installed base products:

Even when the base product is SLES for SAP, the contents of the os-release file should never have been used to identify this fact.

SLES for SAP 12 (no service pack): when registered and patched during the build process, had the correct settings in os-release (all indicating SLES, not 'SLES for SAP'). Also incorrectly has two additional product files in /etc/products.d/
SLES for SAP 12 (no service pack): when not registered and patched during build, had the wrong settings in os-release for NAME, VERSION_ID, PRETTY_NAME, ID and CPR_NAME
SLES for SAP 12.1: the NAME, PRETTY_NAME, ID and CPE_NAME fields were all changed (incorrectly) from a 'SLES' identifier to a 'SLES for SAP' identifier. The contents of the products.d directory correctly reflect the only two entries that should be present.
SLES for SAP 12.2: os-release contents followed the same pattern as SLES for SAP 12.1
SLES for SAP 12.3: os-release contents changed the NAME, PRETTY_NAME and ID fields 'back' to SLES only identifiers. CPE_NAME was left stating 'SLES for SAP' (this was an over-sight).
SLES for SAP 12.4: os-release contents followed the same pattern as SLES for SAP 12.3
SLES for SAP 15: os-release contents match the original correct syntax from SLES 12 (no service pack) with CPE_NAME also correctly reflecting SLES. The contents of the products.d directory has changed with this release to reflect the new packaging/module schema.

And indeed, my CPE strings for SLES for SAP 15 and up are incorrect. I'll need to implement an extra check for the base products (present in updates.txt).

Treat HTTP error 429 properly

HTTP error 429 is "Too many requests". It needs to be added to the retry_states list so it can be properly managed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.