From 609f74d230c26deb3247cb6160d19d203197258a Mon Sep 17 00:00:00 2001 From: YQ Business Services Date: Wed, 31 Jan 2024 18:56:11 +0000 Subject: [PATCH 1/4] fix: Respect delay between checks in api.wait_deleted() --- src/opalstack/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opalstack/api.py b/src/opalstack/api.py index dea4a41..f09b918 100644 --- a/src/opalstack/api.py +++ b/src/opalstack/api.py @@ -131,7 +131,7 @@ def wait_deleted(self, model_name, uuids, delay=5.0, tries=0): pending_uuids = list(uuids) i = 0 while True: - #time.sleep(delay) + time.sleep(delay) i += 1 log.debug(f'Checking deleted ({i}/{tries}) for {model_name} uuids: {repr(pending_uuids)}') for uuid in pending_uuids: From d3a9697d73b4286c4322fff0f2f7966f3277666c Mon Sep 17 00:00:00 2001 From: YQ Business Services Date: Wed, 31 Jan 2024 23:36:54 +0000 Subject: [PATCH 2/4] fix: pg_hba update can take up to 60 seconds --- tests/test_psqltool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_psqltool.py b/tests/test_psqltool.py index 76b6a26..2435429 100644 --- a/tests/test_psqltool.py +++ b/tests/test_psqltool.py @@ -75,7 +75,7 @@ def remote_psqldb(psqluser_server, remote_psqluser): def test_psqltool(psqluser_server, local_psqluser, local_psqldb, remote_osuser, remote_psqluser, remote_psqldb): # Some time for pg_hba update - time.sleep(45) + time.sleep(60) this_psqltool = PsqlTool('localhost', 5432, local_psqluser['name'], local_psqluser['default_password'], local_psqldb['name'], 'this.sqlpasswd') this_psqltool.export_local_db('this.sql') From 6277cac5e4064ed16f0dc8ba2b13b2ed4019a72f Mon Sep 17 00:00:00 2001 From: YQ Business Services Date: Fri, 2 Feb 2024 22:59:18 +0000 Subject: [PATCH 3/4] feat: Add apps.mark_installed for use in app install scripts --- src/opalstack/apps.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/opalstack/apps.py b/src/opalstack/apps.py index af4dce9..19ba400 100644 --- a/src/opalstack/apps.py +++ b/src/opalstack/apps.py @@ -16,6 +16,8 @@ def update(self, *args, **kwargs): return super().update(*args, **kwargs) def update_one(self, *args, **kwargs): return super().update_one(*args, **kwargs) def delete(self, *args, **kwargs): return super().delete(*args, **kwargs) def delete_one(self, *args, **kwargs): return super().delete_one(*args, **kwargs) + def mark_installed(self, app_ids): + self.api.http_post_result(f'/app/installed/', [{'id': app_id} for app_id in app_ids], ensure_status=[200]) def check_equals(self, a, b): return ( a['name'] == b['name'] and From 6b985456913d7f06bb88e1d72623c583c82843c0 Mon Sep 17 00:00:00 2001 From: YQ Business Services Date: Wed, 31 Jan 2024 18:59:34 +0000 Subject: [PATCH 4/4] chore: Bump version to 1.0.3 --- setup.cfg | 2 +- src/opalstack/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index d2939aa..924a826 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = opalstack -version = 1.0.2 +version = 1.0.3 author = Opalstack author_email = support@opalstack.com description = Opalstack API Python Library diff --git a/src/opalstack/__init__.py b/src/opalstack/__init__.py index 6d4d68b..8db2332 100644 --- a/src/opalstack/__init__.py +++ b/src/opalstack/__init__.py @@ -1,4 +1,4 @@ -VERSION = '1.0.2' +VERSION = '1.0.3' __version__ = VERSION from .api import Api