python3-cyberfusion-queue-support 2.6.4__tar.gz → 2.7.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/PKG-INFO +1 -1
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/pyproject.toml +1 -1
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/__init__.py +2 -8
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/database.py +4 -2
- python3_cyberfusion_queue_support-2.7.1/src/cyberfusion/QueueSupport/encoders.py +42 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/database_user_drop.py +3 -3
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/database_user_ensure_state.py +7 -7
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/python3_cyberfusion_queue_support.egg-info/PKG-INFO +1 -1
- python3_cyberfusion_queue_support-2.6.4/src/cyberfusion/QueueSupport/encoders.py +0 -21
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/README.md +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/setup.cfg +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/exceptions/__init__.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/interfaces.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/__init__.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/chmod.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/chown.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/command.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/copy.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/database_create.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/database_drop.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/database_user_grant_grant.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/database_user_grant_revoke.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/mkdir.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/move.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/rmtree.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/systemd_daemon_reload.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/systemd_tmp_files_create.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/systemd_unit_disable.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/systemd_unit_enable.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/systemd_unit_reload.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/systemd_unit_restart.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/systemd_unit_start.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/systemd_unit_stop.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/items/unlink.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/migrations/__init__.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/migrations/env.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/migrations/versions/571e55ab5ed5_initial_migration.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/migrations/versions/8023b9eecdd1_add_traceback_to_queue_items.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/migrations/versions/9ae29b5db790_add_string_to_queue_item_outcomes.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/migrations/versions/__init__.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/outcomes.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/sentinels.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/settings.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/cyberfusion/QueueSupport/utilities.py +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/python3_cyberfusion_queue_support.egg-info/SOURCES.txt +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/python3_cyberfusion_queue_support.egg-info/dependency_links.txt +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/python3_cyberfusion_queue_support.egg-info/entry_points.txt +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/python3_cyberfusion_queue_support.egg-info/requires.txt +0 -0
- {python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/src/python3_cyberfusion_queue_support.egg-info/top_level.txt +0 -0
{python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python3-cyberfusion-queue-support
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.7.1
|
|
4
4
|
Summary: Library to queue actions.
|
|
5
5
|
Author-email: Cyberfusion <support@cyberfusion.io>
|
|
6
6
|
Project-URL: Source, https://github.com/CyberfusionIO/python3-cyberfusion-queue-support
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Classes for queue."""
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
-
from copy import copy
|
|
5
4
|
from dataclasses import dataclass
|
|
6
5
|
from typing import List
|
|
7
6
|
import traceback
|
|
@@ -62,18 +61,13 @@ class Queue:
|
|
|
62
61
|
else:
|
|
63
62
|
deduplicated = True
|
|
64
63
|
|
|
65
|
-
item_dict = copy(item.__dict__)
|
|
66
|
-
|
|
67
|
-
del item_dict["_reference"]
|
|
68
|
-
del item_dict["_hide_outcomes"]
|
|
69
|
-
|
|
70
64
|
object_ = QueueItem(
|
|
71
65
|
queue=self.queue_database_object,
|
|
72
66
|
type=item.__class__.__name__,
|
|
73
67
|
reference=item.reference,
|
|
74
68
|
hide_outcomes=item.hide_outcomes,
|
|
75
69
|
deduplicated=deduplicated,
|
|
76
|
-
attributes=
|
|
70
|
+
attributes=item,
|
|
77
71
|
traceback=None,
|
|
78
72
|
)
|
|
79
73
|
|
|
@@ -141,7 +135,7 @@ class Queue:
|
|
|
141
135
|
queue_item=item_mapping.database_object,
|
|
142
136
|
queue_process=process_object,
|
|
143
137
|
type=outcome.__class__.__name__,
|
|
144
|
-
attributes=outcome
|
|
138
|
+
attributes=outcome,
|
|
145
139
|
string=str(outcome),
|
|
146
140
|
)
|
|
147
141
|
)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
1
3
|
from alembic.config import Config
|
|
2
4
|
import os
|
|
3
5
|
import functools
|
|
@@ -13,7 +15,7 @@ from sqlalchemy.ext.declarative import declarative_base
|
|
|
13
15
|
from sqlalchemy import event
|
|
14
16
|
from sqlalchemy.types import JSON
|
|
15
17
|
|
|
16
|
-
from cyberfusion.QueueSupport.encoders import
|
|
18
|
+
from cyberfusion.QueueSupport.encoders import CustomEncoder
|
|
17
19
|
from cyberfusion.QueueSupport.settings import settings
|
|
18
20
|
|
|
19
21
|
|
|
@@ -45,7 +47,7 @@ def run_migrations() -> None:
|
|
|
45
47
|
def make_database_session() -> Session:
|
|
46
48
|
engine = create_engine(
|
|
47
49
|
settings.database_path,
|
|
48
|
-
json_serializer=
|
|
50
|
+
json_serializer=lambda obj: json.dumps(obj, cls=CustomEncoder),
|
|
49
51
|
)
|
|
50
52
|
|
|
51
53
|
event.listen(engine, "connect", set_sqlite_pragma)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
from json import JSONEncoder
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
from cyberfusion.DatabaseSupport.database_user_grants import DatabaseUserGrant
|
|
5
|
+
from cyberfusion.DatabaseSupport.database_users import DatabaseUser
|
|
6
|
+
from cyberfusion.DatabaseSupport.databases import Database
|
|
7
|
+
from cyberfusion.SystemdSupport import Unit
|
|
8
|
+
|
|
9
|
+
from cyberfusion.QueueSupport.outcomes import OutcomeInterface
|
|
10
|
+
from cyberfusion.QueueSupport.items import _Item
|
|
11
|
+
from cyberfusion.QueueSupport.sentinels import UNKNOWN
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class CustomEncoder(JSONEncoder):
|
|
15
|
+
def default(self, o: Any) -> Any:
|
|
16
|
+
if isinstance(o, _Item):
|
|
17
|
+
return {
|
|
18
|
+
key: value for key, value in vars(o).items() if not key.startswith("_")
|
|
19
|
+
}
|
|
20
|
+
elif isinstance(o, OutcomeInterface):
|
|
21
|
+
return vars(o)
|
|
22
|
+
elif isinstance(o, Unit):
|
|
23
|
+
return {"name": o.name}
|
|
24
|
+
elif isinstance(o, Database):
|
|
25
|
+
return {"name": o.name, "server_software_name": o.server_software_name}
|
|
26
|
+
elif isinstance(o, DatabaseUser):
|
|
27
|
+
return {
|
|
28
|
+
"name": o.name,
|
|
29
|
+
"server_software_name": o.server_software_name,
|
|
30
|
+
"host": o.host,
|
|
31
|
+
}
|
|
32
|
+
elif isinstance(o, DatabaseUserGrant):
|
|
33
|
+
return {
|
|
34
|
+
"database": o.database,
|
|
35
|
+
"database_user": o.database_user,
|
|
36
|
+
"privileges_name": o.privilege_names,
|
|
37
|
+
"table_name": o.table_name,
|
|
38
|
+
}
|
|
39
|
+
elif o == UNKNOWN:
|
|
40
|
+
return "unknown"
|
|
41
|
+
|
|
42
|
+
return super().default(o)
|
|
@@ -31,7 +31,7 @@ class DatabaseUserDropItem(_Item):
|
|
|
31
31
|
"""Set attributes."""
|
|
32
32
|
self.server_software_name = server_software_name
|
|
33
33
|
self.name = name
|
|
34
|
-
self.
|
|
34
|
+
self.host = host
|
|
35
35
|
self._reference = reference
|
|
36
36
|
self._hide_outcomes = hide_outcomes
|
|
37
37
|
|
|
@@ -43,7 +43,7 @@ class DatabaseUserDropItem(_Item):
|
|
|
43
43
|
),
|
|
44
44
|
name=self.name,
|
|
45
45
|
server_software_name=self.server_software_name,
|
|
46
|
-
host=self.
|
|
46
|
+
host=self.host,
|
|
47
47
|
)
|
|
48
48
|
|
|
49
49
|
@property
|
|
@@ -77,5 +77,5 @@ class DatabaseUserDropItem(_Item):
|
|
|
77
77
|
return (
|
|
78
78
|
other.server_software_name == self.server_software_name
|
|
79
79
|
and other.name == self.name
|
|
80
|
-
and other.
|
|
80
|
+
and other.host == self.host
|
|
81
81
|
)
|
|
@@ -33,8 +33,8 @@ class DatabaseUserEnsureStateItem(_Item):
|
|
|
33
33
|
"""Set attributes."""
|
|
34
34
|
self.server_software_name = server_software_name
|
|
35
35
|
self.name = name
|
|
36
|
-
self.
|
|
37
|
-
self.
|
|
36
|
+
self._password = password
|
|
37
|
+
self.host = host
|
|
38
38
|
self._reference = reference
|
|
39
39
|
self._hide_outcomes = hide_outcomes
|
|
40
40
|
|
|
@@ -46,8 +46,8 @@ class DatabaseUserEnsureStateItem(_Item):
|
|
|
46
46
|
),
|
|
47
47
|
name=self.name,
|
|
48
48
|
server_software_name=self.server_software_name,
|
|
49
|
-
password=self.
|
|
50
|
-
host=self.
|
|
49
|
+
password=self._password,
|
|
50
|
+
host=self.host,
|
|
51
51
|
)
|
|
52
52
|
|
|
53
53
|
@property
|
|
@@ -66,7 +66,7 @@ class DatabaseUserEnsureStateItem(_Item):
|
|
|
66
66
|
database_user=self.database_user
|
|
67
67
|
)
|
|
68
68
|
)
|
|
69
|
-
elif self.database_user._get_password() != self.
|
|
69
|
+
elif self.database_user._get_password() != self._password:
|
|
70
70
|
outcomes.append(
|
|
71
71
|
DatabaseUserEnsureStateItemEditPasswordOutcome(
|
|
72
72
|
database_user=self.database_user
|
|
@@ -95,6 +95,6 @@ class DatabaseUserEnsureStateItem(_Item):
|
|
|
95
95
|
return (
|
|
96
96
|
other.server_software_name == self.server_software_name
|
|
97
97
|
and other.name == self.name
|
|
98
|
-
and other.
|
|
99
|
-
and other.
|
|
98
|
+
and other.host == self.host
|
|
99
|
+
and other._password == self._password
|
|
100
100
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python3-cyberfusion-queue-support
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.7.1
|
|
4
4
|
Summary: Library to queue actions.
|
|
5
5
|
Author-email: Cyberfusion <support@cyberfusion.io>
|
|
6
6
|
Project-URL: Source, https://github.com/CyberfusionIO/python3-cyberfusion-queue-support
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import json
|
|
2
|
-
from json import JSONEncoder
|
|
3
|
-
from typing import Any
|
|
4
|
-
|
|
5
|
-
from cyberfusion.SystemdSupport import Unit
|
|
6
|
-
|
|
7
|
-
from cyberfusion.QueueSupport.sentinels import UNKNOWN
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class CustomEncoder(JSONEncoder):
|
|
11
|
-
def default(self, o: Any) -> Any:
|
|
12
|
-
if isinstance(o, Unit):
|
|
13
|
-
return {"name": o.name}
|
|
14
|
-
elif o == UNKNOWN:
|
|
15
|
-
return "unknown"
|
|
16
|
-
|
|
17
|
-
return super().default(o)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def json_serialize(obj: Any) -> str:
|
|
21
|
-
return json.dumps(obj, cls=CustomEncoder)
|
{python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/README.md
RENAMED
|
File without changes
|
{python3_cyberfusion_queue_support-2.6.4 → python3_cyberfusion_queue_support-2.7.1}/setup.cfg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|