Hammer fails with Association not found for location in Red Hat Satellite 6.

Solution Verified - Updated -

Environment

  • Red Hat Satellite 6.x.
  • Hammer.

Issue

  • When trying to execute a Hammer command it fails with:
[root@satellite6 ~]# hammer virt-who-config deploy --id 1 --organization-id 1
Could not deploy the Virt Who configuration:
       Association not found for location

Resolution

  • Verify if there are any defaults set for Hammer specifically relating to Organizations and Locations:
[root@satellite6 ~]# hammer defaults list
[root@satellite6 ~]# cat /root/.hammer/defaults.yml
  • After making appropriate changes with regards to the default Organization/Location set in /root/.hammer/defaults.yml the Hammer utility works just fine.

  • Red Hat Satellite 6.5 provides a --no-use-defaults switch to by-pass the default settings:

[root@satellite6.5 ~]# hammer --no-use-defaults virt-who-config deploy --id 1 --organization-id 1

Root Cause

  • Hammer has a default Organization(depending on the situation) or Location set which it reads every time while executing a command.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

1 Comments

Why do you assume there is /root/.hammer/defaults.yml . i dont have it.