mirror of
https://github.com/xcat2/confluent.git
synced 2026-09-05 12:37:56 +00:00
644843b892
Entirely mechanical, produced by `ruff check --fix --select F401,F541,E713` and reviewed rather than taken on faith: deleting an import is only safe if nothing imports it for its side effects or re-exports it. None of the 19 removed names is referenced anywhere in its file, none appears in any string literal, and none of the touched files uses eval, exec, globals() or __import__, so there is no dynamic lookup that could reach them.
26 lines
611 B
Python
26 lines
611 B
Python
#!/usr/bin/python3
|
|
import yaml
|
|
|
|
ainst = {}
|
|
with open('/autoinstall.yaml', 'r') as allin:
|
|
ainst = yaml.safe_load(allin)
|
|
|
|
tz = None
|
|
ntps = []
|
|
with open('/etc/confluent/confluent.deploycfg', 'r') as confluentdeploycfg:
|
|
dcfg = yaml.safe_load(confluentdeploycfg)
|
|
tz = dcfg['timezone']
|
|
ntps = dcfg.get('ntpservers', [])
|
|
|
|
if ntps and not ainst.get('ntp', None):
|
|
ainst['ntp'] = {}
|
|
ainst['ntp']['enabled'] = True
|
|
ainst['ntp']['servers'] = ntps
|
|
|
|
if tz and not ainst.get('timezone'):
|
|
ainst['timezone'] = tz
|
|
|
|
with open('/autoinstall.yaml', 'w') as allout:
|
|
yaml.safe_dump(ainst, allout)
|
|
|