mirror of
https://github.com/xcat2/confluent.git
synced 2026-08-04 00:17:01 +00:00
Fix tenant enumeration path in dump_db_to_directory
os.path.join(ConfigManager._cfgdir, '/tenants/') discards the cfgdir because the second component is absolute, so it resolves to /tenants/ rather than <cfgdir>/tenants. Tenants are not used yet but let's not face this issue in the future.
This commit is contained in:
@@ -3250,13 +3250,14 @@ async def dump_db_to_directory(location, password, redact=None, skipkeys=False,
|
||||
writecfg('globals', json.dumps(bkupglobals))
|
||||
# Handle tenants
|
||||
try:
|
||||
for tenant in os.listdir(
|
||||
os.path.join(ConfigManager._cfgdir, '/tenants/')):
|
||||
writecfg(os.path.join('tenants', tenant, 'main'),
|
||||
await ConfigManager(tenant=tenant)._dump_to_json(
|
||||
redact=redact))
|
||||
tenants = os.listdir(os.path.join(ConfigManager._cfgdir, 'tenants'))
|
||||
except OSError:
|
||||
pass
|
||||
tenants = []
|
||||
for tenant in tenants:
|
||||
os.makedirs(os.path.join(location, 'tenants', tenant), exist_ok=True)
|
||||
writecfg(os.path.join('tenants', tenant, 'main'),
|
||||
await ConfigManager(tenant=tenant)._dump_to_json(
|
||||
redact=redact))
|
||||
|
||||
|
||||
def get_globals():
|
||||
|
||||
Reference in New Issue
Block a user