Skip to content

Commit

Permalink
Merge pull request #625 from furlongm/hooks
Browse files Browse the repository at this point in the history
add dnf hook and ensure hook consistency
  • Loading branch information
furlongm authored Dec 17, 2024
2 parents fe101bd + 26fa775 commit d32dfb2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion hooks/apt/05patchman
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DPkg::Post-Invoke { "if [ -x /usr/sbin/patchman-client ]; then echo 'Sending report to patchman server ...'; /usr/sbin/patchman-client -n ; fi"; };
DPkg::Post-Invoke { "if [ -x /usr/sbin/patchman-client ] ; then echo 'Sending report to patchman server...' ; /usr/sbin/patchman-client -n ; fi"; };
1 change: 1 addition & 0 deletions hooks/dnf/patchman.action
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*:any:if [ -x /usr/sbin/patchman-client ] ; then echo 'Sending report to patchman server...' ; /usr/sbin/patchman-client -n ; fi
3 changes: 1 addition & 2 deletions hooks/yum/patchman.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
# along with Patchman. If not, see <http://www.gnu.org/licenses/>

import os

from yum.plugins import TYPE_CORE

requires_api_version = '2.1'
plugin_type = (TYPE_CORE,)


def posttrans_hook(conduit):
conduit.info(2, 'patchman: sending data')
conduit.info(2, 'Sending report to patchman server...')
servicecmd = conduit.confString('main',
'servicecmd',
'/usr/sbin/patchman-client')
Expand Down
4 changes: 2 additions & 2 deletions hooks/zypper/patchman.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# along with Patchman. If not, see <http://www.gnu.org/licenses/>
#
# zypp system plugin for patchman
#

import os
import logging
from zypp_plugin import Plugin
Expand All @@ -33,7 +33,7 @@ def PLUGINBEGIN(self, headers, body):
def PACKAGESETCHANGED(self, headers, body):
logging.info('PACKAGESETCHANGED')
logging.debug(f'headers: {headers!s}')
print('patchman: sending data')
print('Sending report to patchman server...')
servicecmd = '/usr/sbin/patchman-client'
args = '-n'
command = f'{servicecmd!s} {args!s}> /dev/null'
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ requires = /usr/bin/python3
python3-importlib-metadata
policycoreutils-python-utils
httpd
python3-dnf-plugin-post-transaction-actions

[install]
optimize=1

0 comments on commit d32dfb2

Please sign in to comment.