Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
bouda1 authored and jean-christophe81 committed Sep 26, 2024
1 parent 3d2a55e commit 55323ad
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 67 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/centreon-collect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
legacy_engine:
description: 'Compile Engine with legacy configuration library'
required: true
default: true
default: false
type: boolean
packages_in_artifact:
description: 'Save packages in artifacts'
Expand Down Expand Up @@ -291,11 +291,6 @@ jobs:
stability: ${{ needs.get-version.outputs.stability }}
legacy_engine: ${{ github.event.inputs.legacy_engine == 'true' }}
packages_in_artifact: ${{ github.event.inputs.packages_in_artifact == 'true' }}
image: ${{ matrix.image }}
distrib: ${{ matrix.distrib }}
package_extension: ${{ matrix.package_extension }}
runner: ${{ matrix.runner }}
arch: ${{ matrix.arch }}
secrets: inherit

robot-test:
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/package-collect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,6 @@ on:
packages_in_artifact:
required: true
type: boolean
image:
required: true
type: string
distrib:
required: true
type: string
package_extension:
required: true
type: string
runner:
required: true
type: string
arch:
required: true
type: string


jobs:
package:
Expand Down
5 changes: 2 additions & 3 deletions common/engine_legacy_conf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ if(LEGACY_ENGINE)
tag.cc
timeperiod.cc)

add_dependencies(engine_legacy_conf pb_neb_lib pb_bam_lib)
target_compile_definitions(engine_legacy_conf PRIVATE LEGACY_CONF)
include_directories(${CMAKE_SOURCE_DIR}/common/inc)
add_dependencies(engine_legacy_conf pb_neb_lib pb_bam_lib)
include_directories(${CMAKE_SOURCE_DIR}/common/inc)

target_precompile_headers(engine_legacy_conf PRIVATE
${CMAKE_SOURCE_DIR}/common/precomp_inc/precomp.hh)
Expand Down
2 changes: 1 addition & 1 deletion engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ include_directories(enginerpc ${CMAKE_SOURCE_DIR}/common/src

# centenginestats target.
add_executable(centenginestats "${SRC_DIR}/centenginestats.cc")
add_dependencies(centenginestats centreon_clib pb_neb_lib)
add_dependencies(centenginestats centreon_clib)
target_link_libraries(centenginestats centreon_clib fmt::fmt)
target_precompile_headers(centenginestats PRIVATE ${PRECOMP_HEADER})

Expand Down
41 changes: 0 additions & 41 deletions tests/resources/Engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,47 +933,6 @@ def ctn_engine_config_delete_value_in_hosts(idx: int, desc: str, key: str, file:
"""
Delete a parameter in the hosts.cfg for the Engine configuration idx.
Args:
idx (int): Index of the Engine configuration (from 0)
desc (str): host name of the host to modify.
key (str): the parameter that will be deleted.
file (str): The file to modify, default value 'hosts.cfg'
"""


filename = f"{ETC_ROOT}/centreon-engine/config{idx}/{file}"
with open(filename, "r") as f:
lines = f.readlines()

r = re.compile(r"^\s*host_name\s+" + desc + "\s*$")
rbis = re.compile(r"^\s*name\s+" + desc + "\s*$")
found = False
for i in range(len(lines)):
if r.match(lines[i]):
print("here" + lines[i])
for j in range(i + 1, len(lines)):
if '}' in lines[j]:
break
if key in lines[j]:
del lines[j]
found = True
break
break

if not found:
for i in range(len(lines)):
if rbis.match(lines[i]):
for j in range(i + 1, len(lines)):
if '}' in lines[j]:
break
if key in lines[j]:
del lines[j]
found = True
break
break
with open(filename, "w") as f:
f.writelines(lines)

def ctn_engine_config_replace_value_in_hosts(idx: int, desc: str, key: str, value: str, file: str = 'hosts.cfg'):
"""
Change a parameter in the hosts.cfg file of the Engine config idx.
Expand Down

0 comments on commit 55323ad

Please sign in to comment.