8000 Add deprecation notice to code by thom-at-redhat · Pull Request #1101 · ansible/receptor · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add deprecation notice to code #1101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/source/user_guide/configuration_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ Configure workers that process units of work
- Run a worker using Kubernetes
* - ``--work-python``
- Run a worker using a Python plugin
[DEPRECATION WARNING] This option is not currently being used. This feature will be removed from receptor in a future release
* - ``--work-signing``
- Private key to sign work submissions
* - ``--work-verification``
Expand Down Expand Up @@ -720,7 +721,7 @@ Work Kubernetes
Work Python
^^^^^^^^^^^

.. list-table:: Work Python
.. list-table:: Work Python [DEPRECATION WARNING] This option is not currently being used. This feature will be removed from receptor in a future release
:header-rows: 1
:widths: auto

Expand Down
8 changes: 6 additions & 2 deletions pkg/workceptor/python.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import (
"encoding/json"
"errors"
"fmt"
"os/exec"

Expand All @@ -21,6 +22,7 @@

// Start launches a job with given parameters.
func (pw *pythonUnit) Start() error {
pw.UpdateBasicStatus(WorkStatePending, "[DEPRECATION WARNING] This option is not currently being used. This feature will be removed from receptor in a future release.", 0)

Check warning on line 25 in pkg/workceptor/python.go

View check run for this annotation

Codecov / codecov/patch

pkg/workceptor/python.go#L25

Added line #L25 was not covered by tests
pw.UpdateBasicStatus(WorkStatePending, "Launching Python runner", 0)
config := make(map[string]interface{})
for k, v := range pw.config {
Expand Down Expand Up @@ -72,10 +74,12 @@
func (cfg workPythonCfg) Run() error {
err := MainInstance.RegisterWorker(cfg.WorkType, cfg.NewWorker, false)

return err
errWithDeprecation := errors.Join(err, errors.New("[DEPRECATION WARNING] This option is not currently being used. This feature will be removed from receptor in a future release"))

Check warning on line 77 in pkg/workceptor/python.go

View check run for this annotation

Codecov / codecov/patch

pkg/workceptor/python.go#L77

Added line #L77 was not covered by tests

return errWithDeprecation

Check warning on line 79 in pkg/workceptor/python.go

View check run for this annotation

Codecov / codecov/patch

pkg/workceptor/python.go#L79

Added line #L79 was not covered by tests
}

func init() {
cmdline.RegisterConfigTypeForApp("receptor-workers",
"work-python", "Run a worker using a Python plugin", workPythonCfg{}, cmdline.Section(workersSection))
"work-python", "Run a worker using a Python plugin\n[DEPRECATION WARNING] This option is not currently being used. This feature will be removed from receptor in a future release.", workPythonCfg{}, cmdline.Section(workersSection))
}
0