Skip to content

Commit 4ded8a7

Browse files
committed
stabilize
1 parent 3675886 commit 4ded8a7

4 files changed

Lines changed: 15 additions & 68 deletions

File tree

.github/workflows/build-release-latest.yml

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -26,49 +26,15 @@ jobs:
2626
- run: docker pull ${{ steps.get_image.outputs.IMAGE }} || docker build -t ${{ steps.get_image.outputs.IMAGE }} -f dockerfiles/checkmk/Dockerfile .
2727
- run: docker push ${{ steps.get_image.outputs.IMAGE }}
2828

29-
build-package-ci:
30-
runs-on: ubuntu-latest
31-
needs: build-image
32-
container:
33-
image: ${{ needs.build-image.outputs.image }}
34-
env:
35-
CMK: /omd/sites/cmk
36-
SU: su - cmk -c
37-
steps:
38-
- uses: actions/checkout@v4
39-
- run: build-mkp.sh
40-
# upload results
41-
- uses: actions/upload-artifact@v4
42-
with:
43-
path: ./mkp/*.mkp
44-
retention-days: 1
45-
4629
build-package:
4730
runs-on: ubuntu-latest
4831
needs: build-image
4932
container:
5033
image: ${{ needs.build-image.outputs.image }}
51-
env:
52-
CMK: /omd/sites/cmk
53-
SU: su - cmk -c
5434
steps:
5535
- uses: actions/checkout@v4
56-
- run: cp -r mkp/local/* ${CMK}/local
57-
- run: ${SU} "mkdir ${CMK}/tmp/check_mk"
58-
- run: ${SU} "mkp template yum"
59-
- run: git config --global --add safe.directory ${PWD}
60-
- run: modify-extension.py ${PWD} ${CMK}/tmp/check_mk/yum.manifest.temp
61-
# avoid error:
62-
# Error removing file /omd/sites/cmk/local/lib/python3/cmk/base/cee/plugins/bakery/yum.py: [Errno 13] Permission denied: '/omd/sites/cmk/local/lib/python3/cmk/base/cee/plugins/bakery/yum.py'
63-
# and likewise the `mkp package` fails due to already existing files
64-
- run: chmod go+rw ${CMK}/local/lib/python3/cmk/base/cee/plugins/bakery
65-
- run: chmod go+rw ${CMK}/local/lib/python3/cmk_addons/plugins/yum/agent_based
66-
- run: chmod go+rw ${CMK}/local/lib/python3/cmk_addons/plugins/yum/checkman
67-
- run: chmod go+rw ${CMK}/local/lib/python3/cmk_addons/plugins/yum/rulesets
68-
- run: cat ${CMK}/tmp/check_mk/yum.manifest.temp
69-
- run: ${SU} "mkp package ${CMK}/tmp/check_mk/yum.manifest.temp"
70-
# copy created extension package back to workspace
71-
- run: cp ${CMK}/var/check_mk/packages_local/*.mkp ${PWD}/mkp/
36+
# use script
37+
- run: build-mkp.sh
7238
# upload results
7339
- uses: actions/upload-artifact@v4
7440
with:

.github/workflows/build-release-stable.yml

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,10 @@ jobs:
3030
needs: build-image
3131
container:
3232
image: ${{ needs.build-image.outputs.image }}
33-
env:
34-
CMK: /omd/sites/cmk
35-
SU: su - cmk -c
3633
steps:
3734
- uses: actions/checkout@v4
38-
- run: cp -r mkp/local/* ${CMK}/local
39-
- run: ${SU} "mkdir ${CMK}/tmp/check_mk"
40-
- run: ${SU} "mkp template yum"
41-
- run: git config --global --add safe.directory ${PWD}
42-
- run: modify-extension.py ${PWD} ${CMK}/tmp/check_mk/yum.manifest.temp
43-
# avoid error:
44-
# Error removing file /omd/sites/cmk/local/lib/python3/cmk/base/cee/plugins/bakery/yum.py: [Errno 13] Permission denied: '/omd/sites/cmk/local/lib/python3/cmk/base/cee/plugins/bakery/yum.py'
45-
# and likewise the `mkp package` fails due to already existing files
46-
- run: chmod go+rw ${CMK}/local/lib/python3/cmk/base/cee/plugins/bakery
47-
- run: chmod go+rw ${CMK}/local/lib/python3/cmk_addons/plugins/yum/agent_based
48-
- run: chmod go+rw ${CMK}/local/lib/python3/cmk_addons/plugins/yum/checkman
49-
- run: chmod go+rw ${CMK}/local/lib/python3/cmk_addons/plugins/yum/rulesets
50-
- run: cat ${CMK}/tmp/check_mk/yum.manifest.temp
51-
- run: ${SU} "mkp package ${CMK}/tmp/check_mk/yum.manifest.temp"
52-
# copy created extension package back to workspace
53-
- run: cp ${CMK}/var/check_mk/packages_local/*.mkp ${PWD}/mkp/
35+
# use script
36+
- run: build-mkp.sh
5437
# upload results
5538
- uses: actions/upload-artifact@v4
5639
with:

mkp/local/lib/python3/cmk/base/cee/plugins/bakery/yum.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,26 @@ def get_yum_files(conf: Any) -> FileGenerator:
1515
1616
"""
1717

18-
# debugging
19-
with open('/tmp/debug-get_yum_files.txt', 'a') as debug_file:
20-
debug_file.write(f'config: {conf}\n')
18+
# debugging - might become an option later
19+
#with open('/tmp/debug-get_yum_files.txt', 'a') as debug_file:
20+
# debug_file.write(f'config: {conf}\n')
2121

2222
# default to no interval - will be filled if set in config
2323
interval = None
24+
# flag to decide if plugin should be deployed
2425
deploy_plugin = False
2526

2627
if isinstance(conf, dict):
2728
deploy = conf.get('deploy')
28-
# backward compatible
29+
# backward compatible - first check if 'interval' is still used
2930
if deploy is None:
3031
if isinstance(conf.get('interval'), dict):
3132
try:
3233
interval = int(conf.get('interval'))
3334
except (TypeError, ValueError):
3435
interval = None
3536
deploy_plugin = True
36-
37+
# existence of 'deploy' dict
3738
elif isinstance(deploy, dict):
3839
interval = deploy.get('interval')
3940
if interval is not None:

mkp/local/lib/python3/cmk_addons/plugins/yum/rulesets/yum_cee.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,11 @@ def _migrate_int_to_float(value: object) -> Mapping[str, object]:
3535
migrate from integer interval to float interval
3636
"""
3737

38-
# debugging
39-
with open('/tmp/debug-migrate_int_to_float.txt', 'a') as debug_file:
40-
debug_file.write(f'value: {value}\n')
38+
# debugging - might become an option later
39+
#with open('/tmp/debug-migrate_int_to_float.txt', 'a') as debug_file:
40+
# debug_file.write(f'value: {value}\n')
4141

4242
if value is not None:
43-
# backward compatibility - migrate from deploy to deployment
4443
if value.get('deploy'):
4544
if value['deploy'].get('interval'):
4645
return {
@@ -54,7 +53,7 @@ def _migrate_int_to_float(value: object) -> Mapping[str, object]:
5453
'interval': dict()
5554
}
5655
}
57-
# fix a short time used interval instead of deploy
56+
# backward compatibility - migrate from interval to deploy
5857
elif value.get('interval'):
5958
return {
6059
'deploy': {
@@ -71,9 +70,7 @@ def _migrate_int_to_float(value: object) -> Mapping[str, object]:
7170
else:
7271
return value
7372
else:
74-
# return {
75-
# 'deploy': dict()
76-
# }
73+
# empty dictionary means no deployment
7774
return dict()
7875

7976

0 commit comments

Comments
 (0)