summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmunin/publik_count7
-rwxr-xr-xmunin/publik_count_7
-rwxr-xr-xmunin/publik_recent_count7
3 files changed, 16 insertions, 5 deletions
diff --git a/munin/publik_count b/munin/publik_count
index 1d127b0..0c0d79b 100755
--- a/munin/publik_count
+++ b/munin/publik_count
@@ -35,9 +35,12 @@ for tenant in itertools.chain(os.listdir(base_dir), os.listdir(os.path.join(base
continue
if tenant.endswith('.invalid'):
continue
- if not os.path.isdir(os.path.join(base_dir, tenant)):
+ dirname = os.path.join(base_dir, tenant)
+ if not os.path.exists(dirname):
+ dirname = os.path.join(base_dir, 'tenants', tenant)
+ if not os.path.isdir(dirname):
continue
- cfg = pickle.load(open(os.path.join(base_dir, tenant, 'config.pck'), 'rb'), encoding='utf-8')
+ cfg = pickle.load(open(os.path.join(dirname, 'config.pck'), 'rb'), encoding='utf-8')
if 'postgresql' not in cfg:
continue
psql_cfg = {}
diff --git a/munin/publik_count_ b/munin/publik_count_
index 173c38c..14aa8d6 100755
--- a/munin/publik_count_
+++ b/munin/publik_count_
@@ -35,7 +35,12 @@ total_logged_user_count.label Front by logged user
for tenant_dir in itertools.chain(os.listdir(base_dir), os.listdir(os.path.join(base_dir, 'tenants'))):
if tenant_dir != tenant:
continue
- cfg = pickle.load(open(os.path.join(base_dir, tenant, 'config.pck'), 'rb'), encoding='utf-8')
+ dirname = os.path.join(base_dir, tenant)
+ if not os.path.exists(dirname):
+ dirname = os.path.join(base_dir, 'tenants', tenant)
+ if not os.path.isdir(dirname):
+ continue
+ cfg = pickle.load(open(os.path.join(dirname, 'config.pck'), 'rb'), encoding='utf-8')
if 'postgresql' not in cfg:
continue
psql_cfg = {}
diff --git a/munin/publik_recent_count b/munin/publik_recent_count
index 52c0361..f269feb 100755
--- a/munin/publik_recent_count
+++ b/munin/publik_recent_count
@@ -44,9 +44,12 @@ for tenant in itertools.chain(os.listdir(base_dir), os.listdir(os.path.join(base
continue
if tenant.endswith('.invalid'):
continue
- if not os.path.isdir(os.path.join(base_dir, tenant)):
+ dirname = os.path.join(base_dir, tenant)
+ if not os.path.exists(dirname):
+ dirname = os.path.join(base_dir, 'tenants', tenant)
+ if not os.path.isdir(dirname):
continue
- cfg = pickle.load(open(os.path.join(base_dir, tenant, 'config.pck'), 'rb'), encoding='utf-8')
+ cfg = pickle.load(open(os.path.join(dirname, 'config.pck'), 'rb'), encoding='utf-8')
if 'postgresql' not in cfg:
continue
psql_cfg = {}