Skip to content

Commit

Permalink
Merge pull request #11582 from Security-Onion-Solutions/minechanges
Browse files Browse the repository at this point in the history
handle a minion not being in the mine data return
  • Loading branch information
m0duspwnens authored Oct 20, 2023
2 parents 5119e6c + 2e16250 commit 2878f82
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion salt/salt/engines/master/checkmine.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ def mine_update(minion):
mine_delete(minion, 'x509.get_pem_entries')
mine_update(minion)
continue
except KeyError:
log.error('checkmine engine: found minion %s is not in the mine' % (minion))
mine_flush(minion)
mine_update(minion)

# Update the mine if the ip in the mine doesn't match returned from manage.alived
network_ip_addrs = __salt__['saltutil.runner']('mine.get', tgt=minion, fun='network.ip_addrs')
Expand All @@ -77,5 +81,8 @@ def mine_update(minion):
log.error('checkmine engine: found minion %s does\'t have a mine_ip' % (minion))
mine_delete(minion, 'network.ip_addrs')
mine_update(minion)

except KeyError:
log.error('checkmine engine: found minion %s is not in the mine' % (minion))
mine_flush(minion)
mine_update(minion)
sleep(interval)

0 comments on commit 2878f82

Please sign in to comment.