Skip to content

Commit

Permalink
Fix missing topic binding for Satellite 6.5 and above (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
hao-yu authored Jul 13, 2020
1 parent 549f6af commit b67fb99
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion satellite-reset
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

SAT_MAJOR_VERSION=$(rpm -q satellite --queryformat "%{VERSION}" | cut -d "." -f 1)
SAT_MINOR_VERSION=$(rpm -q satellite --queryformat "%{VERSION}" | cut -d "." -f 2)

emessage(){
#echo ""
GREEN='\033[0;32m'
Expand Down Expand Up @@ -130,7 +133,16 @@ resetjournals(){

qpid-config --ssl-certificate /etc/pki/katello/certs/`hostname`-qpid-broker.crt --ssl-key /etc/pki/katello/private/`hostname`-qpid-broker.key -b amqps://localhost:5671 add exchange topic event --durable
qpid-config --ssl-certificate /etc/pki/katello/certs/`hostname`-qpid-broker.crt --ssl-key /etc/pki/katello/private/`hostname`-qpid-broker.key -b amqps://localhost:5671 add queue katello_event_queue --durable
for key in compliance.created entitlement.created entitlement.deleted pool.created pool.deleted; do

if [[ $SAT_MAJOR_VERSION -eq 6 && $SAT_MINOR_VERSION -lt 5 ]]; then
emessage "Binding 5 events.."
bindings=(compliance.created entitlement.created entitlement.deleted pool.created pool.deleted)
else
emessage "Binding 6 events.."
bindings=(compliance.created entitlement.created entitlement.deleted pool.created pool.deleted system_purpose_compliance.created)
fi

for key in "${bindings[@]}"; do
qpid-config --ssl-certificate /etc/pki/katello/certs/`hostname`-qpid-broker.crt --ssl-key /etc/pki/katello/private/`hostname`-qpid-broker.key -b amqps://localhost:5671 bind event katello_event_queue $key
done

Expand Down

0 comments on commit b67fb99

Please sign in to comment.