Skip to content

Commit 770816b

Browse files
committed
Added APT and YUM hooks
1 parent f7884cd commit 770816b

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

hooks/apt/05patchman

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DPkg::Post-Invoke { "if [ -x /usr/sbin/patchman-client ]; then echo 'Sending report to patchman server ...'; patchman-client -n ; fi"; };

hooks/yum/patchman.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[main]
2+
enabled=1

hooks/yum/patchman.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import os
2+
from glob import fnmatch
3+
4+
import yum
5+
from yum.plugins import PluginYumExit, TYPE_CORE
6+
7+
requires_api_version = '2.1'
8+
plugin_type = (TYPE_CORE,)
9+
10+
def posttrans_hook(conduit):
11+
conduit.info(2, 'patchman: sending data')
12+
servicecmd = conduit.confString('main', 'servicecmd', '/usr/sbin/patchman-client')
13+
args = '-n'
14+
command = '%s %s> /dev/null' % (servicecmd, args)
15+
os.system(command)

0 commit comments

Comments
 (0)