From eeba5c5bae8f98fc42a4e2b99ccd9f1ecf8880f2 Mon Sep 17 00:00:00 2001 From: ronny abraham Date: Wed, 10 Jan 2024 07:10:00 +0200 Subject: [PATCH] updated dockstrings for docker, got rid of TODO in django/coverage --- modules/django.py | 4 ---- modules/docker.py | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/modules/django.py b/modules/django.py index 5af031b..f2535f0 100644 --- a/modules/django.py +++ b/modules/django.py @@ -330,10 +330,6 @@ def coverage(application=None, args="test", workingdir=None, outputdir=None, the application parameter is required because currently I do not know how to run manage.py test on all installed applications. - TODO: - test if coverage is installed and if it isn't give an error explaining - the problem - TODO: currently, django.manage:test is not working properly because it does not find the tests on all installed applications. Instead, each diff --git a/modules/docker.py b/modules/docker.py index f78cae3..1fd581c 100644 --- a/modules/docker.py +++ b/modules/docker.py @@ -70,6 +70,27 @@ def docker_ip(): def docker_run(cmd): + """ + Executes a Docker command either locally or on a remote host. + + This function facilitates the execution of Docker commands. It determines + whether to run the command directly or with sudo based on the host + configuration. If the Docker database host is set to 'local', it assumes a + local (OSX) environment where the user can directly run Docker commands. + Otherwise, for remote hosts, it uses sudo for command execution. + + :param cmd: The Docker command to be executed. + :type cmd: str + + Note: + - The function uses 'executize' to dynamically select between 'run' and + 'sudo' methods from fabric.operations based on the host setting. + - If 'env.debug' is enabled, the command to be executed is logged for + debugging purposes. + + :returns: None. The function executes a command but does not return any + value. + """ configuration = env.config if env.debug: