python3-cyberfusion-systemd-support 2.1.0__tar.gz → 2.3.0__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_systemd_support-2.1.0 → python3_cyberfusion_systemd_support-2.3.0}/PKG-INFO +3 -2
- {python3_cyberfusion_systemd_support-2.1.0 → python3_cyberfusion_systemd_support-2.3.0}/README.md +1 -0
- {python3_cyberfusion_systemd_support-2.1.0 → python3_cyberfusion_systemd_support-2.3.0}/pyproject.toml +1 -1
- {python3_cyberfusion_systemd_support-2.1.0 → python3_cyberfusion_systemd_support-2.3.0}/src/cyberfusion/SystemdSupport/units.py +28 -0
- {python3_cyberfusion_systemd_support-2.1.0 → python3_cyberfusion_systemd_support-2.3.0}/src/python3_cyberfusion_systemd_support.egg-info/PKG-INFO +3 -2
- {python3_cyberfusion_systemd_support-2.1.0 → python3_cyberfusion_systemd_support-2.3.0}/setup.cfg +0 -0
- {python3_cyberfusion_systemd_support-2.1.0 → python3_cyberfusion_systemd_support-2.3.0}/src/cyberfusion/SystemdSupport/__init__.py +0 -0
- {python3_cyberfusion_systemd_support-2.1.0 → python3_cyberfusion_systemd_support-2.3.0}/src/cyberfusion/SystemdSupport/_constants.py +0 -0
- {python3_cyberfusion_systemd_support-2.1.0 → python3_cyberfusion_systemd_support-2.3.0}/src/cyberfusion/SystemdSupport/manager.py +0 -0
- {python3_cyberfusion_systemd_support-2.1.0 → python3_cyberfusion_systemd_support-2.3.0}/src/cyberfusion/SystemdSupport/tmp_files.py +0 -0
- {python3_cyberfusion_systemd_support-2.1.0 → python3_cyberfusion_systemd_support-2.3.0}/src/python3_cyberfusion_systemd_support.egg-info/SOURCES.txt +0 -0
- {python3_cyberfusion_systemd_support-2.1.0 → python3_cyberfusion_systemd_support-2.3.0}/src/python3_cyberfusion_systemd_support.egg-info/dependency_links.txt +0 -0
- {python3_cyberfusion_systemd_support-2.1.0 → python3_cyberfusion_systemd_support-2.3.0}/src/python3_cyberfusion_systemd_support.egg-info/requires.txt +0 -0
- {python3_cyberfusion_systemd_support-2.1.0 → python3_cyberfusion_systemd_support-2.3.0}/src/python3_cyberfusion_systemd_support.egg-info/top_level.txt +0 -0
{python3_cyberfusion_systemd_support-2.1.0 → python3_cyberfusion_systemd_support-2.3.0}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: python3-cyberfusion-systemd-support
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: Library for systemd.
|
|
5
5
|
Author-email: Cyberfusion <support@cyberfusion.io>
|
|
6
6
|
Project-URL: Source, https://github.com/CyberfusionIO/python3-cyberfusion-systemd-support
|
|
@@ -49,6 +49,7 @@ unit.reload()
|
|
|
49
49
|
|
|
50
50
|
print(unit.is_active)
|
|
51
51
|
print(unit.is_enabled)
|
|
52
|
+
print(unit.is_failed)
|
|
52
53
|
```
|
|
53
54
|
|
|
54
55
|
## Tmp files
|
|
@@ -145,7 +145,35 @@ class Unit:
|
|
|
145
145
|
|
|
146
146
|
return True
|
|
147
147
|
|
|
148
|
+
@property
|
|
149
|
+
def is_failed(self) -> bool:
|
|
150
|
+
"""Get if unit is enabled."""
|
|
151
|
+
try:
|
|
152
|
+
subprocess.run(
|
|
153
|
+
[SYSTEMCTL_BIN, "is-failed", "--quiet", self.name], check=True
|
|
154
|
+
)
|
|
155
|
+
except subprocess.CalledProcessError:
|
|
156
|
+
return False
|
|
157
|
+
|
|
158
|
+
return True
|
|
159
|
+
|
|
148
160
|
@staticmethod
|
|
149
161
|
def get_drop_in_directory(unit_name: str) -> str:
|
|
150
162
|
"""Get unit override directory."""
|
|
151
163
|
return os.path.join(BASE_DIRECTORY_SYSTEMD_UNITS, unit_name + ".d")
|
|
164
|
+
|
|
165
|
+
@staticmethod
|
|
166
|
+
def remove_unit_type(unit_name: str) -> str:
|
|
167
|
+
"""Remove unit type from unit name.
|
|
168
|
+
|
|
169
|
+
E.g.: `firewall.service` -> `firewall`
|
|
170
|
+
"""
|
|
171
|
+
return unit_name.rsplit(".", 1)[0]
|
|
172
|
+
|
|
173
|
+
@staticmethod
|
|
174
|
+
def add_unit_type(unit_name: str, unit_type: str) -> str:
|
|
175
|
+
"""Add unit type to unit name.
|
|
176
|
+
|
|
177
|
+
E.g.: `firewall` -> `firewall.service`
|
|
178
|
+
"""
|
|
179
|
+
return unit_name + "." + unit_type
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: python3-cyberfusion-systemd-support
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: Library for systemd.
|
|
5
5
|
Author-email: Cyberfusion <support@cyberfusion.io>
|
|
6
6
|
Project-URL: Source, https://github.com/CyberfusionIO/python3-cyberfusion-systemd-support
|
|
@@ -49,6 +49,7 @@ unit.reload()
|
|
|
49
49
|
|
|
50
50
|
print(unit.is_active)
|
|
51
51
|
print(unit.is_enabled)
|
|
52
|
+
print(unit.is_failed)
|
|
52
53
|
```
|
|
53
54
|
|
|
54
55
|
## Tmp files
|
{python3_cyberfusion_systemd_support-2.1.0 → python3_cyberfusion_systemd_support-2.3.0}/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
|