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

Better error reporting for missing client value #14

Closed taftsanders closed 11 months ago

taftsanders commented 11 months ago

When running on a Satellite without a client the following error can be seen:

# python3 satellite_leapp_check.py 

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 is installed
Enter your Satellite Username: admin
Enter your Password: 
❌ No client value given
- Please provide a client value with the command
- Example: "satellite_leapp_check -c client.example.com"
Traceback (most recent call last):
  File "/root/taft/satellite_leapp_check.py", line 638, in <module>
    main()
  File "/root/taft/satellite_leapp_check.py", line 629, in main
    parse_client()
  File "/root/taft/satellite_leapp_check.py", line 572, in parse_client
    arch = parse_for_arch(client)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/taft/satellite_leapp_check.py", line 370, in parse_for_arch
    arch = client['architecture_name']
           ~~~~~~^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable