/[smeserver]/rpms/smeserver-yum/sme10/smeserver-yum-2.6.0-bz11175-pre-and-post-actions.patch
ViewVC logotype

Contents of /rpms/smeserver-yum/sme10/smeserver-yum-2.6.0-bz11175-pre-and-post-actions.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Mon Jul 11 15:20:18 2022 UTC (2 years, 4 months ago) by jpp
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
bump version

1 diff -Nur smeserver-yum-2.6.0.old/root/usr/lib/yum-plugins/smeserver.py smeserver-yum-2.6.0/root/usr/lib/yum-plugins/smeserver.py
2 --- smeserver-yum-2.6.0.old/root/usr/lib/yum-plugins/smeserver.py 2020-11-15 01:12:19.273000000 -0500
3 +++ smeserver-yum-2.6.0/root/usr/lib/yum-plugins/smeserver.py 2020-11-15 01:14:00.376000000 -0500
4 @@ -20,6 +20,8 @@
5
6 eventlist = dict()
7 actionlist = dict()
8 +actionlistpre = dict()
9 +actionlistpost = dict()
10 templateslist = dict()
11 serviceslist = dict()
12
13 @@ -100,6 +102,8 @@
14 global smechange
15 global eventlist
16 global actionlist
17 + global actionlistpre
18 + global actionlistpost
19 global templateslist
20 global serviceslist
21 global erasing
22 @@ -161,6 +165,8 @@
23 global smechange
24 global eventlist
25 global actionlist
26 + global actionlistpre
27 + global actionlistpost
28 global templateslist
29 global serviceslist
30 global erasing
31 @@ -225,8 +231,15 @@
32 mytmpaction = os.path.realpath(os.readlink(tmppath + f).replace("..",events_path))
33 #print "link " + f + ": " + mytmpaction
34
35 - if not actionlist.has_key(mytmpaction):
36 - actionlist[mytmpaction] = mytmpaction
37 + if f < "S05generic_template_expand":
38 + if not actionlistpre.has_key(mytmpaction):
39 + actionlistpre[mytmpaction] = mytmpaction
40 + elif f > "S90adjust-services":
41 + if not actionlistpost.has_key(mytmpaction):
42 + actionlistpost[mytmpaction] = mytmpaction
43 + else:
44 + if not actionlist.has_key(mytmpaction):
45 + actionlist[mytmpaction] = mytmpaction
46
47 if os.path.isdir(tmppath + "templates2expand" + os.sep):
48 tmppathtmpl = tmppath + "templates2expand" + os.sep
49 @@ -277,9 +290,9 @@
50 # now, if smechange is false (no reboot needed), we can execute actions, expan templates and adjust services
51 #if not smechange:
52
53 - if len(actionlist)>0:
54 - print "Executing actions"
55 - for kactions in actionlist:
56 + if len(actionlistpre)>0:
57 + print "Executing early actions"
58 + for kactions in actionlistpre:
59 #print kactions
60 if os.path.isfile(kactions):
61 os.spawnl(os.P_WAIT, kactions, kactions)
62 @@ -293,12 +306,25 @@
63 if os.path.exists(mytemplatedir) or os.path.exists(mytemplatemeta):
64 os.spawnl(os.P_WAIT, expand_template, expand_template, ktemplates)
65
66 + if len(actionlist)>0:
67 + print "Executing actions"
68 + for kactions in actionlist:
69 + #print kactions
70 + if os.path.isfile(kactions):
71 + os.spawnl(os.P_WAIT, kactions, kactions,"post-upgrade")
72 +
73 if len(serviceslist)>0:
74 print "Adjusting services"
75 for kservices in serviceslist:
76 print kservices + ": " + serviceslist[kservices]
77 os.spawnl(os.P_WAIT, service, service, kservices, serviceslist[kservices])
78
79 + if len(actionlistpost)>0:
80 + print "Executing late actions"
81 + for kactions in actionlistpost:
82 + #print kactions
83 + if os.path.isfile(kactions):
84 + os.spawnl(os.P_WAIT, kactions, kactions)
85
86 if smechange:
87 os.spawnl(os.P_WAIT, config_set, config_set, 'set', 'UnsavedChanges', 'yes')

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed