Add warning when running devel (#67502)
* Add warning when running devel. Addresses #67362 * Add config entry to disable devel warning, so it doesn't impact CI * Update warning about using devel
This commit is contained in:
parent
3aae025cce
commit
c61c0f7ad5
4 changed files with 18 additions and 2 deletions
|
@ -88,7 +88,7 @@ Which Ansible version to install is based on your particular needs. You can choo
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
You should only run Ansible from ``devel`` if you are actively developing content for Ansible. This is a rapidly changing source of code and can become unstable at any point.
|
You should only run Ansible from ``devel`` if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at any point.
|
||||||
|
|
||||||
|
|
||||||
Ansible creates new releases two to three times a year. Due to this short release cycle,
|
Ansible creates new releases two to three times a year. Due to this short release cycle,
|
||||||
|
@ -363,7 +363,7 @@ Running Ansible from source (devel)
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
You should only run Ansible from ``devel`` if you are actively developing content for Ansible. This is a rapidly changing source of code and can become unstable at any point.
|
You should only run Ansible from ``devel`` if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at any point.
|
||||||
|
|
||||||
Ansible is easy to run from source. You do not need ``root`` permissions
|
Ansible is easy to run from source. You do not need ``root`` permissions
|
||||||
to use it and there is no software to actually install. No daemons
|
to use it and there is no software to actually install. No daemons
|
||||||
|
|
|
@ -70,6 +70,13 @@ class CLI(with_metaclass(ABCMeta, object)):
|
||||||
self.parser = None
|
self.parser = None
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
|
|
||||||
|
if C.DEVEL_WARNING and __version__.endswith('dev0'):
|
||||||
|
display.warning(
|
||||||
|
'You are running the development version of Ansible. You should only run Ansible from "devel" if '
|
||||||
|
'you are modifying the Ansible engine, or trying out features under development. This is a rapidly '
|
||||||
|
'changing source of code and can become unstable at any point.'
|
||||||
|
)
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def run(self):
|
def run(self):
|
||||||
"""Run the ansible command
|
"""Run the ansible command
|
||||||
|
|
|
@ -1227,6 +1227,14 @@ DEPRECATION_WARNINGS:
|
||||||
ini:
|
ini:
|
||||||
- {key: deprecation_warnings, section: defaults}
|
- {key: deprecation_warnings, section: defaults}
|
||||||
type: boolean
|
type: boolean
|
||||||
|
DEVEL_WARNING:
|
||||||
|
nane: Running devel warning
|
||||||
|
default: True
|
||||||
|
description: Toggle to control showing warnings related to running devel
|
||||||
|
env: [{name: ANSIBLE_DEVEL_WARNING}]
|
||||||
|
ini:
|
||||||
|
- {key: devel_warning, section: defaults}
|
||||||
|
type: boolean
|
||||||
DIFF_ALWAYS:
|
DIFF_ALWAYS:
|
||||||
name: Show differences
|
name: Show differences
|
||||||
default: False
|
default: False
|
||||||
|
|
|
@ -71,6 +71,7 @@ def ansible_environment(args, color=True, ansible_config=None):
|
||||||
ANSIBLE_RETRY_FILES_ENABLED='false',
|
ANSIBLE_RETRY_FILES_ENABLED='false',
|
||||||
ANSIBLE_CONFIG=ansible_config,
|
ANSIBLE_CONFIG=ansible_config,
|
||||||
ANSIBLE_LIBRARY='/dev/null',
|
ANSIBLE_LIBRARY='/dev/null',
|
||||||
|
ANSIBLE_DEVEL_WARNING='false', # Don't show warnings that CI is running devel
|
||||||
PYTHONPATH=get_ansible_python_path(),
|
PYTHONPATH=get_ansible_python_path(),
|
||||||
PAGER='/bin/cat',
|
PAGER='/bin/cat',
|
||||||
PATH=path,
|
PATH=path,
|
||||||
|
|
Loading…
Add table
Reference in a new issue