Skip to content

Commit

Permalink
Make sure that repo connection is available when getting repo powa ve…
Browse files Browse the repository at this point in the history
…rsion.

Thanks to Adrien Nayrat for the report and testing the patch.
  • Loading branch information
rjuju committed Jan 21, 2021
1 parent e064555 commit c2fcfa8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.1.1:
Bugfix:
- Make sure that repo connection is available when getting repo powa
version (Julien Rouhaud, thanks to Adrien Nayrat for the report and
testing the patch)

1.1.0:
New features:
- Avoid explicit "LOAD 'powa'" with poWA 4.1.0, so a superuser isn't
Expand Down
2 changes: 1 addition & 1 deletion powa_collector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import json
import signal

__VERSION__ = '1.1.0'
__VERSION__ = '1.1.1'
__VERSION_NUM__ = [int(part) for part in __VERSION__.split('.')]


Expand Down
5 changes: 3 additions & 2 deletions powa_collector/powa_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,16 @@ def __maybe_load_powa(self, conn):
def __save_versions(self):
srvid = self.__config["srvid"]

if (self.__repo_conn is None):
self.__connect()

ver = self.__get_powa_version(self.__repo_conn)

# Check and update PG and dependencies versions, for powa 4.1+
if (not ver or (int(ver[0][0]) == 4 and int(ver[0][1]) == 0)):
return

self.logger.debug("Checking postgres and dependencies versions")
if (self.__repo_conn is None):
self.__connect()

if (self.__remote_conn is None or self.__repo_conn is None):
self.logger.error("Could not check PoWA")
Expand Down

0 comments on commit c2fcfa8

Please sign in to comment.