Skip to content
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

Fixes #11812: Standardize generic methods name #658

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions qa-test
@@ -0,0 +1,3 @@
#!/bin/bash

make test-common
6 changes: 3 additions & 3 deletions tools/ncf.py
Expand Up @@ -29,10 +29,10 @@

tags = {}
tags["common"] = ["bundle_name", "bundle_args"]
tags["generic_method"] = [ "name", "description", "documentation", "parameter", "class_prefix", "class_parameter", "class_parameter_id", "deprecated", "agent_version", "agent_requirements", "parameter_constraint" ]
tags["generic_method"] = [ "name", "description", "documentation", "parameter", "class_prefix", "class_parameter", "class_parameter_id", "deprecated", "agent_version", "agent_requirements", "parameter_constraint", "action", "rename" ]
tags["technique"] = [ "name", "description", "version" ]
optionnal_tags = [ "deprecated", "documentation", "parameter_constraint", "agent_requirements" ]
multiline_tags = [ "description", "documentation" ]
optionnal_tags = [ "deprecated", "documentation", "parameter_constraint", "agent_requirements", "action", "rename" ]
multiline_tags = [ "description", "documentation", "deprecated" ]

class NcfError(Exception):
def __init__(self, message, details="", cause=None):
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions tree/30_generic_methods/_service_check_running_smf.cf
Expand Up @@ -24,6 +24,7 @@
# @class_prefix service_check_running
# @class_parameter service_name
# @deprecated Use [service_check_running](#service_check_running) instead.
# @rename service_check_running

bundle agent _service_check_running_smf(service_name)
{
Expand Down
1 change: 1 addition & 0 deletions tree/30_generic_methods/_service_check_running_src.cf
Expand Up @@ -24,6 +24,7 @@
# @class_prefix service_check_running
# @class_parameter service_name
# @deprecated Use [service_check_running](#service_check_running) instead.
# @rename service_check_running

bundle agent _service_check_running_src(service_name)
{
Expand Down
1 change: 1 addition & 0 deletions tree/30_generic_methods/command_execution.cf
Expand Up @@ -18,6 +18,7 @@

# @name Command execution
# @description Execute a command
# @action
#
# @parameter command_name Command name
#
Expand Down
1 change: 1 addition & 0 deletions tree/30_generic_methods/command_execution_result.cf
Expand Up @@ -18,6 +18,7 @@

# @name Command execution result
# @description Execute a command and create outcome classes depending on its exit code
# @action
# @documentation Execute a command and create outcome classes
# depending on the exit codes given in parameters.
# If an exit code is not in the list it will lead to an error status.
Expand Down
5 changes: 4 additions & 1 deletion tree/30_generic_methods/file_from_template.cf
Expand Up @@ -18,11 +18,14 @@

# @name File from template
# @description Build a file from a legacy CFEngine template
# @deprecated This method uses CFEngine's templating which is deprecated and not portable accross agents.
# Please use [file_from_template_mustache](#file_from_template_mustache) or [file_from_template_jinja2](#file_from_template_jinja2) instead.
#
# @documentation See [file_from_template_type](#file_from_template_type) for general documentation about
# templates usage.
#
# @parameter source_template Source file containing a template to be expanded (absolute path on the target node)
# @parameter destination Destination file (absolute path on the target node)
# @parameter destination Destination file (absolute path on the target node)
#
# @class_prefix file_from_template
# @class_parameter destination
Expand Down
1 change: 1 addition & 0 deletions tree/30_generic_methods/file_replace_lines.cf
Expand Up @@ -17,6 +17,7 @@
#####################################################################################

# @name File replace lines
# @action If the regex matches the replacement, then the line will be replaced every time
# @description Ensure that a line in a file is replaced by another one
# @documentation You can replace lines in a files, based on regular expression and captured pattern
#
Expand Down
3 changes: 2 additions & 1 deletion tree/30_generic_methods/file_template_expand.cf
Expand Up @@ -17,6 +17,8 @@
#####################################################################################

# @name File template expand
# @deprecated This method uses CFEngine's templating which is deprecated and not portable accross agents.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The is already a deprecated tag below.

# Please use [file_from_template_mustache](#file_from_template_mustache) or [file_from_template_jinja2](#file_from_template_jinja2) instead.
# @description This is a bundle to expand a template in a specific location
#
# @parameter tml_file File name (with full path within the framework) of the template file
Expand All @@ -27,7 +29,6 @@
#
# @class_prefix file_template_expand
# @class_parameter target_file
# @deprecated Use [file_from_template](#file_from_template) instead.

bundle agent file_template_expand(tml_file, target_file, mode, owner, group)
{
Expand Down
Expand Up @@ -18,6 +18,7 @@

# @name HTTP request check status with headers
# @description Checks status of an HTTP URL
# @action We don't know when HTTP methods cause side effect, this can be an action or not depending on your server behaviour
# @documentation Perform a HTTP request on the URL, method and headers provided and check that the response has the expected status code (ie 200, 404, 503, etc)
#
# @parameter method Method to call the URL (GET, POST, PUT, DELETE)
Expand Down
1 change: 1 addition & 0 deletions tree/30_generic_methods/http_request_content_headers.cf
Expand Up @@ -18,6 +18,7 @@

# @name HTTP request sending content with headers
# @description Make an HTTP request with a specific header
# @action We don't know when HTTP methods cause side effect, this can be an action or not depending on your server behaviour
# @documentation Perform a HTTP request on the URL, method and headers provided
# and send the content provided. Will return an error if the request failed.
#
Expand Down
1 change: 1 addition & 0 deletions tree/30_generic_methods/service_action.cf
Expand Up @@ -18,6 +18,7 @@

# @name Service action
# @description Trigger an action on a service using the approriate tool
# @action is-* commands are not actions, but all other commands are
#
# @documentation The `service_*` methods manage the services running on the system.
#
Expand Down
1 change: 1 addition & 0 deletions tree/30_generic_methods/service_reload.cf
Expand Up @@ -18,6 +18,7 @@

# @name Service reload
# @description Reload a service using the appropriate method
# @action
# @documentation See [service_action](#service_action) for documentation.
#
# @parameter service_name Name of the service
Expand Down
1 change: 1 addition & 0 deletions tree/30_generic_methods/service_restart.cf
Expand Up @@ -18,6 +18,7 @@

# @name Service restart
# @description Restart a service using the appropriate method
# @action
# @documentation See [service_action](#service_action) for documentation.
#
# @parameter service_name Name of the service
Expand Down
1 change: 1 addition & 0 deletions tree/30_generic_methods/service_restart_if.cf
Expand Up @@ -18,6 +18,7 @@

# @name Service restart at a condition
# @description Restart a service using the appropriate method if the specified class is true, otherwise it is considered as not required and success classes are returned.
# @deprecated Use [service_restart](#service_restart) with a condition
# @documentation See [service_action](#service_action) for documentation.
#
# @parameter service_name Name of the service
Expand Down
3 changes: 3 additions & 0 deletions tree/30_generic_methods/service_start.cf
Expand Up @@ -18,6 +18,9 @@

# @name Service start
# @description Start a service using the appropriate method
# @deprecated This is an action that should not be used in the general case.
# If you really want to call the start method, use [service_action](#service_action).
# Otherwise, simply call [service_started](#service_started)
# @documentation See [service_action](#service_action) for documentation.
#
# @parameter service_name Name of the service
Expand Down
3 changes: 3 additions & 0 deletions tree/30_generic_methods/service_stop.cf
Expand Up @@ -18,6 +18,9 @@

# @name Service stop
# @description Stop a service using the appropriate method
# @deprecated This is an action that should not be used in the general case.
# If you really want to call the stop method, use [service_action](#service_action).
# Otherwise, simply call [service_stopped](#service_stopped)
# @documentation See [service_action](#service_action) for documentation.
#
# @parameter service_name Name of the service
Expand Down
3 changes: 3 additions & 0 deletions tree/30_generic_methods/user_create.cf
Expand Up @@ -18,6 +18,9 @@

# @name User create
# @description Create a user
# @deprecated Please split into calls to other user_* methods:
# [user_present](#user_present) [user_fullname](#user_fullname) [user_home](#user_home)
# [user_primary_group](#user_primary_group) [user_shell](#user_shell) and [user_locked](#user_locked)
# @documentation This method does not create the user's home directory.
# @agent_version >=3.6
#
Expand Down