netbox-docker-plugin 2.7.0__tar.gz → 2.8.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.
- {netbox_docker_plugin-2.7.0/netbox_docker_plugin.egg-info → netbox_docker_plugin-2.8.0}/PKG-INFO +1 -1
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/__init__.py +1 -1
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/models/container.py +6 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/signals.py +1 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container-layout.html +14 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/container/test_container_actions.py +34 -10
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0/netbox_docker_plugin.egg-info}/PKG-INFO +1 -1
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/pyproject.toml +1 -1
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/LICENSE +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/MANIFEST.in +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/README.md +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/api/__init__.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/api/renderers.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/api/serializers.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/api/urls.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/api/views.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/filtersets.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/__init__.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/bind.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/container.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/device.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/env.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/host.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/image.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/label.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/mount.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/network.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/network_setting.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/port.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/registry.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/volume.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0001_initial.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0002_image.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0003_image_size.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0004_volume.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0005_network.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0006_container_port_mount_label_env_and_more.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0007_remove_container_netbox_docker_plugin_container_unique_name_host__and_more.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0008_alter_network_unique_together_network_networkid_and_more.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0009_remove_container_network_networksettings_and_more.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0010_container_containerid_and_more.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0011_host_token.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0012_host_state.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0013_host_netbox_url.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0014_container_operation.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0015_remove_mount_netbox_docker_plugin_mount_unique_volume_and_more.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0016_alter_env_value.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0017_network_state.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0018_alter_mount_volume_alter_networksetting_network.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0019_host_agent_version_host_docker_api_version.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0020_container_hostname.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0021_registry_and_more.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0022_bind_bind_netbox_docker_plugin_bind_unique_bind.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0023_delete_hosts.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0024_registry_host_alter_registry_name_and_more.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0025_alter_image_version.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0026_image_digest.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0027_container_restart_policy.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0028_mount_and_bind_read_only.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0029_alter_container_state.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0030_alter_container_containerid_alter_container_hostname_and_more.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0031_container_cap_add.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/0032_device_and_more.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/migrations/__init__.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/models/__init__.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/models/host.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/models/image.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/models/network.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/models/registry.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/models/volume.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/navigation.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tables.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container-exec.html +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container-logs.html +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/templates/netbox_docker_plugin/container.html +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/templates/netbox_docker_plugin/host-graph.html +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/templates/netbox_docker_plugin/host.html +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/templates/netbox_docker_plugin/image.html +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/templates/netbox_docker_plugin/network.html +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/templates/netbox_docker_plugin/registry.html +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/templates/netbox_docker_plugin/volume.html +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/templatetags/__init__.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/templatetags/host.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/__init__.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/base.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/container/__init__.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/container/test_container_api.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/container/test_container_api_exec.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/container/test_container_operation_view.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/container/test_container_validation.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/container/test_container_views.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/host/__init__.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/host/test_host_api.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/host/test_host_views.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/host/test_replace_password.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/image/__init__.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/image/test_image_api.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/image/test_image_views.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/network/__init__.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/network/test_network_api.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/network/test_network_views.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/registry/__init__.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/registry/test_registry_api.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/registry/test_registry_views.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/test_init.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/volume/__init__.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/volume/test_volume_api.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/volume/test_volume_views.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/urls.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/utilities/__init__.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/__init__.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/bind.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/container.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/device.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/env.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/host.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/image.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/label.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/mount.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/network.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/network_setting.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/port.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/registry.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/volume.py +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin.egg-info/SOURCES.txt +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin.egg-info/dependency_links.txt +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin.egg-info/top_level.txt +0 -0
- {netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/setup.cfg +0 -0
{netbox_docker_plugin-2.7.0/netbox_docker_plugin.egg-info → netbox_docker_plugin-2.8.0}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: netbox-docker-plugin
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.8.0
|
|
4
4
|
Summary: Manage Docker with Netbox & style.
|
|
5
5
|
Author-email: Vincent Simonin <vincent@saashup.com>, David Delassus <david.jose.delassus@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/SaaShup/netbox-docker-plugin
|
|
@@ -10,7 +10,7 @@ class NetBoxDockerConfig(PluginConfig):
|
|
|
10
10
|
name = "netbox_docker_plugin"
|
|
11
11
|
verbose_name = " NetBox Docker Plugin"
|
|
12
12
|
description = "Manage Docker"
|
|
13
|
-
version = "2.
|
|
13
|
+
version = "2.8.0"
|
|
14
14
|
base_url = "docker"
|
|
15
15
|
min_version = "4.0.0"
|
|
16
16
|
author= "Vincent Simonin <vincent@saashup.com>, David Delassus <david.jose.delassus@gmail.com>"
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/models/container.py
RENAMED
|
@@ -53,6 +53,7 @@ class ContainerOperationChoices(ChoiceSet):
|
|
|
53
53
|
("restart", "Restart", "blue"),
|
|
54
54
|
("stop", "Stop", "blue"),
|
|
55
55
|
("recreate", "Recreate", "blue"),
|
|
56
|
+
("kill", "Kill", "red"),
|
|
56
57
|
("none", "None", "white"),
|
|
57
58
|
]
|
|
58
59
|
|
|
@@ -188,6 +189,11 @@ class Container(NetBoxModel):
|
|
|
188
189
|
"dead",
|
|
189
190
|
]
|
|
190
191
|
|
|
192
|
+
@property
|
|
193
|
+
def can_kill(self) -> bool:
|
|
194
|
+
"""Check if the container can be killed"""
|
|
195
|
+
return self.state in ["created", "restarting", "running", "exited", "dead"]
|
|
196
|
+
|
|
191
197
|
class Meta:
|
|
192
198
|
"""Image Model Meta Class"""
|
|
193
199
|
|
|
@@ -42,6 +42,7 @@ def restrict_container_actions(instance, **_kwargs):
|
|
|
42
42
|
instance.operation == "restart" and not instance.can_restart,
|
|
43
43
|
instance.operation == "stop" and not instance.can_stop,
|
|
44
44
|
instance.operation == "recreate" and not instance.can_recreate,
|
|
45
|
+
instance.operation == "kill" and not instance.can_kill,
|
|
45
46
|
]
|
|
46
47
|
):
|
|
47
48
|
raise AbortRequest(
|
|
@@ -45,6 +45,20 @@
|
|
|
45
45
|
</button>
|
|
46
46
|
</form>
|
|
47
47
|
|
|
48
|
+
<form action="{% url 'plugins:netbox_docker_plugin:container_operation' pk=object.id operation='kill' %}" method="post">
|
|
49
|
+
{% csrf_token %}
|
|
50
|
+
<input type="hidden" name="operation" value="kill">
|
|
51
|
+
<button
|
|
52
|
+
type="submit"
|
|
53
|
+
class="btn btn-dark"
|
|
54
|
+
{% if not object.can_kill %}
|
|
55
|
+
disabled
|
|
56
|
+
{% endif %}
|
|
57
|
+
>
|
|
58
|
+
<i class="mdi mdi-skull"></i> Kill
|
|
59
|
+
</button>
|
|
60
|
+
</form>
|
|
61
|
+
|
|
48
62
|
<form action="{% url 'plugins:netbox_docker_plugin:container_operation' pk=object.id operation='recreate' %}" method="post">
|
|
49
63
|
{% csrf_token %}
|
|
50
64
|
<input type="hidden" name="operation" value="recreate">
|
|
@@ -10,12 +10,12 @@ from netbox_docker_plugin.models.registry import Registry
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class ContainerActionTestCase(TestCase):
|
|
13
|
-
"""
|
|
13
|
+
"""Test the various scenarii of container actions"""
|
|
14
14
|
|
|
15
15
|
objects = {}
|
|
16
16
|
|
|
17
17
|
def test_allowed_operations(self):
|
|
18
|
-
"""
|
|
18
|
+
"""Test that only specific operations are allowed according to a state"""
|
|
19
19
|
|
|
20
20
|
cases = [
|
|
21
21
|
("create", ["none"]),
|
|
@@ -23,7 +23,19 @@ class ContainerActionTestCase(TestCase):
|
|
|
23
23
|
("stop", ["running"]),
|
|
24
24
|
("restart", ["running"]),
|
|
25
25
|
("recreate", ["created", "exited", "dead", "running"]),
|
|
26
|
-
("
|
|
26
|
+
("kill", ["created", "restarting", "running", "exited", "dead"]),
|
|
27
|
+
(
|
|
28
|
+
"noop",
|
|
29
|
+
[
|
|
30
|
+
"created",
|
|
31
|
+
"restarting",
|
|
32
|
+
"running",
|
|
33
|
+
"paused",
|
|
34
|
+
"exited",
|
|
35
|
+
"dead",
|
|
36
|
+
"none",
|
|
37
|
+
],
|
|
38
|
+
),
|
|
27
39
|
]
|
|
28
40
|
|
|
29
41
|
for operation, states in cases:
|
|
@@ -48,14 +60,18 @@ class ContainerActionTestCase(TestCase):
|
|
|
48
60
|
)
|
|
49
61
|
|
|
50
62
|
def test_forbidden_operations(self):
|
|
51
|
-
"""
|
|
63
|
+
"""Test that forbidden operations raise an AbortRequest"""
|
|
52
64
|
|
|
53
65
|
cases = [
|
|
54
|
-
(
|
|
66
|
+
(
|
|
67
|
+
"create",
|
|
68
|
+
["created", "restarting", "running", "paused", "exited", "dead"],
|
|
69
|
+
),
|
|
55
70
|
("start", ["running", "restarting", "paused", "none"]),
|
|
56
71
|
("stop", ["created", "restarting", "paused", "exited", "dead", "none"]),
|
|
57
72
|
("restart", ["created", "restarting", "paused", "exited", "dead", "none"]),
|
|
58
73
|
("recreate", ["restarting", "paused", "none"]),
|
|
74
|
+
("kill", ["paused", "none"]),
|
|
59
75
|
]
|
|
60
76
|
|
|
61
77
|
for operation, states in cases:
|
|
@@ -79,7 +95,7 @@ class ContainerActionTestCase(TestCase):
|
|
|
79
95
|
obj.save()
|
|
80
96
|
|
|
81
97
|
def test_delete_non_running_container(self):
|
|
82
|
-
"""
|
|
98
|
+
"""Test that a non running container can be deleted"""
|
|
83
99
|
|
|
84
100
|
for state in ["created", "paused", "exited", "dead"]:
|
|
85
101
|
with self.subTest(operation="delete", state=state):
|
|
@@ -98,7 +114,7 @@ class ContainerActionTestCase(TestCase):
|
|
|
98
114
|
self.assertFalse(Container.objects.filter(name=name).exists())
|
|
99
115
|
|
|
100
116
|
def test_delete_running_container(self):
|
|
101
|
-
"""
|
|
117
|
+
"""Test that a running container cannot be deleted"""
|
|
102
118
|
|
|
103
119
|
for state in ["running", "restarting", "none"]:
|
|
104
120
|
with self.subTest(operation="delete", state=state):
|
|
@@ -119,9 +135,17 @@ class ContainerActionTestCase(TestCase):
|
|
|
119
135
|
obj.delete()
|
|
120
136
|
|
|
121
137
|
def test_delete_container_on_deleted_host(self):
|
|
122
|
-
"""
|
|
123
|
-
|
|
124
|
-
for state in [
|
|
138
|
+
"""Test that a container on a deleted host can be deleted"""
|
|
139
|
+
|
|
140
|
+
for state in [
|
|
141
|
+
"created",
|
|
142
|
+
"running",
|
|
143
|
+
"restarted",
|
|
144
|
+
"paused",
|
|
145
|
+
"exited",
|
|
146
|
+
"dead",
|
|
147
|
+
"none",
|
|
148
|
+
]:
|
|
125
149
|
with self.subTest(operation="delete", state=state):
|
|
126
150
|
with transaction.atomic():
|
|
127
151
|
name = f"container-delete-{state}"
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0/netbox_docker_plugin.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: netbox-docker-plugin
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.8.0
|
|
4
4
|
Summary: Manage Docker with Netbox & style.
|
|
5
5
|
Author-email: Vincent Simonin <vincent@saashup.com>, David Delassus <david.jose.delassus@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/SaaShup/netbox-docker-plugin
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/api/__init__.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/api/renderers.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/api/serializers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/filtersets.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/__init__.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/bind.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/container.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/device.py
RENAMED
|
File without changes
|
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/host.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/image.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/label.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/mount.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/network.py
RENAMED
|
File without changes
|
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/port.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/registry.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/forms/volume.py
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
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/models/__init__.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/models/host.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/models/image.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/models/network.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/models/registry.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/models/volume.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/navigation.py
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
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/templatetags/host.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/__init__.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/base.py
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
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/tests/test_init.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/utilities/__init__.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/__init__.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/bind.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/container.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/device.py
RENAMED
|
File without changes
|
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/host.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/image.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/label.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/mount.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/network.py
RENAMED
|
File without changes
|
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/port.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/registry.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin/views/volume.py
RENAMED
|
File without changes
|
{netbox_docker_plugin-2.7.0 → netbox_docker_plugin-2.8.0}/netbox_docker_plugin.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|