From 6afdb298fa872cd0baa5649a743a0dcae6008fa4 Mon Sep 17 00:00:00 2001 From: bunkerity Date: Thu, 25 Aug 2022 10:33:09 +0200 Subject: [PATCH] lua - fix pcall for asn/country mmdb lookup --- .github/workflows/dev.yml | 8 ++++---- lua/utils.lua | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 024d0f170..43f3cd33f 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -374,10 +374,10 @@ jobs: run: cat /opt/.runner_env >> $GITHUB_ENV # Run tests - # - name: Run Docker tests - # run: ./tests/main.py "docker" - # - name: Run Autoconf tests - # run: ./tests/main.py "autoconf" + - name: Run Docker tests + run: ./tests/main.py "docker" + - name: Run Autoconf tests + run: ./tests/main.py "autoconf" - name: Run Swarm tests run: ./tests/main.py "swarm" - name: Run Kubernetes tests diff --git a/lua/utils.lua b/lua/utils.lua index c91615d81..195df506c 100644 --- a/lua/utils.lua +++ b/lua/utils.lua @@ -317,7 +317,7 @@ utils.get_country = function(ip) if not mmdb.country_db then return false, "mmdb country not loaded" end - local ok, result, err = pcall(mmdb.country_db:lookup(ip)) + local ok, result, err = pcall(mmdb.country_db.lookup, mmdb.country_db, ip) if not ok then return nil, result end @@ -331,7 +331,7 @@ utils.get_asn = function(ip) if not mmdb.asn_db then return false, "mmdb asn not loaded" end - local ok, result, err = pcall(mmdb.asn_db:lookup(ip)) + local ok, result, err = pcall(mmdb.asn_db.lookup, mmdb.asn_db, ip) if not ok then return nil, result end