taftsanders / satellite-leapp-check

A script to run on the Satellite or the upgrading client to validate clients have the required repositories for the LEAPP upgrade process
GNU General Public License v3.0
4 stars 3 forks source link

Reporting duplicate repositories not enabled for an organization #45

Closed taftsanders closed 8 months ago

taftsanders commented 9 months ago

The script is showing Appstream 8 is not enabled for the organization for a host twice:

[root@bombsat614 tmp]# python3 satellite_leapp_check.py -v 8.6 -u admin -c drone79.usersys.redhat.com

Thanks for using satellite_leapp_check.
Please report all bugs or issues found to https://github.com/taftsanders/satellite-leapp-check/issues
This script is used in determining the availability of the correct repositories for a client for leapp upgrade
This script currently only supports RHEL 7 to 8 upgrade for x86_64 Intel architecture

satellite-installer package detected on executing server
Calling the Satellite API for information on the specified client
Enter your Password: 
Searching for host drone79.usersys.redhat.com
✅ RHEL 7 version detected
❌ Organization ID 1 is missing Red Hat Enterprise Linux 8 for x86_64 - AppStream RPMs None
❌ Organization ID 1 is missing Red Hat Enterprise Linux 8 for x86_64 - AppStream RPMs None

However, the repository is enabled on this org. Error on reporting enabled repos in Satellite 6.14 and duplicating the repo name.

taftsanders commented 9 months ago

looks like the provided leapp version global isn't getting set from argparse:

[root@bombsat614 tmp]# python3 satellite_leapp_check.py -v 8.6 -u admin -c drone79.usersys.redhat.com -p redhat

Thanks for using satellite_leapp_check.
Please report all bugs or issues found to https://github.com/taftsanders/satellite-leapp-check/issues
This script is used in determining the availability of the correct repositories for a client for leapp upgrade
This script currently only supports RHEL 7 to 8 upgrade for x86_64 Intel architecture

satellite-installer package detected on executing server
Calling the Satellite API for information on the specified client
Searching for host drone79.usersys.redhat.com
> /tmp/satellite_leapp_check.py(132)get_leapp_version()
-> if args.version:
(Pdb) args.version
LEAPP_VERSION = None
(Pdb) bool(args.version)
True
(Pdb) LEAPP_VERSION
(Pdb) print(LEAPP_VERSION)
None
(Pdb) l
127         print()
128  
129     def get_leapp_version(LEAPP_VERSION=None):
130         import pdb; pdb.set_trace()
131         global RHEL_8_VERSIONS
132  ->     if args.version:
133             if args.version in RHEL_8_VERSIONS:
134                 LEAPP_VERSION = args.version
135             else:
136                 print(FAIL+"Leapp version not known")
137                 print("\tLeapp version should be either 8.6, 8.8, 8.9, or 8.10")
(Pdb) 
taftsanders commented 9 months ago

After pushing commit https://github.com/taftsanders/satellite-leapp-check/compare/main...45-reporting-duplicate-repositories-not-enabled-for-an-organization we are seeing the following error when parsing the client's content view

[root@bombsat614 tmp]# python3 /root/satellite_leapp_check.py -v 8.6 -u admin -c drone79.usersys.redhat.com -p redhat

Thanks for using satellite_leapp_check.
Please report all bugs or issues found to https://github.com/taftsanders/satellite-leapp-check/issues
This script is used in determining the availability of the correct repositories for a client for leapp upgrade
This script currently only supports RHEL 7 to 8 upgrade for x86_64 Intel architecture

satellite-installer package detected on executing server
Calling the Satellite API for information on the specified client
Searching for host drone79.usersys.redhat.com
> /root/satellite_leapp_check.py(132)get_leapp_version()
-> if args.version:
(Pdb) c
✅ RHEL 7 version detected
✅ Organization ID 1 has the required repos enabled
Checking client's content view for repo availability
Traceback (most recent call last):
  File "/root/satellite_leapp_check.py", line 719, in <module>
    main()
  File "/root/satellite_leapp_check.py", line 710, in main
    parse_client()
  File "/root/satellite_leapp_check.py", line 660, in parse_client
    cv,cv_id = parse_for_content_view(client)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/satellite_leapp_check.py", line 385, in parse_for_content_view
    content_view = client['content_facet_attributes']['content_view_name']
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'content_view_name'
taftsanders commented 8 months ago

this issue was resolved in issue #46