Skip to content

Commit bba7193

Browse files
fdriesslernedjitef
authored andcommitted
changed bakery to work with both explicit passwords as well as password_store
1 parent 1d70ea3 commit bba7193

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/check_mk/base/cee/plugins/bakery/proxmox_bs.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# which is part of this source code package.
88

99
import pprint
10+
import sys
1011
from pathlib import Path
1112
from typing import Any, Dict
1213

@@ -18,6 +19,8 @@
1819
register,
1920
)
2021

22+
from cmk.utils import password_store
23+
2124

2225
def get_proxmox_bs_files(conf: Dict[str, Any]) -> FileGenerator:
2326
if conf is not None:
@@ -26,6 +29,14 @@ def get_proxmox_bs_files(conf: Dict[str, Any]) -> FileGenerator:
2629
source=Path("proxmox_bs"),
2730
interval=3600,
2831
)
32+
password = conf.get('auth_pass')
33+
if password[1] == "explicit_password":
34+
secret = password[2][1]
35+
elif password[1] == "stored_password":
36+
secret = password_store.lookup(password_store.password_store_path(), password[2][0])
37+
else:
38+
secret = ""
39+
sys.exit(1)
2940
yield PluginConfig(
3041
base_os=OS.LINUX,
3142
lines=[

0 commit comments

Comments
 (0)