From 9178e176b554fe260fb25743aaeb4bb9079d34f5 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 17 May 2017 01:00:15 +0800 Subject: [PATCH] Limit sphinx version on python 2.6. (#24678) * Limit sphinx version on python 2.6. * Fix issues identified by rstcheck. --- .../docsite/rst/dev_guide/developing_modules.rst | 2 +- .../dev_guide/developing_modules_documenting.rst | 2 +- .../rst/dev_guide/developing_modules_general.rst | 16 ++++++++-------- .../docsite/rst/dev_guide/developing_plugins.rst | 1 + docs/docsite/rst/playbooks_filters.rst | 1 + test/runner/requirements/constraints.txt | 1 + 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/docs/docsite/rst/dev_guide/developing_modules.rst b/docs/docsite/rst/dev_guide/developing_modules.rst index 03d74d7899..b1f58986c1 100644 --- a/docs/docsite/rst/dev_guide/developing_modules.rst +++ b/docs/docsite/rst/dev_guide/developing_modules.rst @@ -41,7 +41,7 @@ For more information about action plugins, go `here `_. +Check out the `roles documentation `_. .. _developing_modules_all: diff --git a/docs/docsite/rst/dev_guide/developing_modules_documenting.rst b/docs/docsite/rst/dev_guide/developing_modules_documenting.rst index 3ecb4132ba..539b539d39 100644 --- a/docs/docsite/rst/dev_guide/developing_modules_documenting.rst +++ b/docs/docsite/rst/dev_guide/developing_modules_documenting.rst @@ -219,7 +219,7 @@ RETURN Block The RETURN section documents what the module returns, and is required for all new modules. For each value returned, provide a ``description``, in what circumstances the value is ``returned``, -the ``type`` of the value and a ``sample``. For example, from the ``copy`` module:: +the ``type`` of the value and a ``sample``. For example, from the ``copy`` module: The following fields can be used and are all required unless specified otherwise. diff --git a/docs/docsite/rst/dev_guide/developing_modules_general.rst b/docs/docsite/rst/dev_guide/developing_modules_general.rst index 032d594b8c..20f7cc558e 100644 --- a/docs/docsite/rst/dev_guide/developing_modules_general.rst +++ b/docs/docsite/rst/dev_guide/developing_modules_general.rst @@ -33,9 +33,9 @@ Ok, let's get going with an example. We're going to use Python. For starters, import json date = str(datetime.datetime.now()) - print json.dumps({ + print(json.dumps({ "time" : date - }) + })) .. _module_testing: @@ -146,10 +146,10 @@ a lot shorter than this: # can be added. if rc != 0: - print json.dumps({ + print(json.dumps({ "failed" : True, "msg" : "failed setting the time" - }) + })) sys.exit(1) # when things do not fail, we do not @@ -160,10 +160,10 @@ a lot shorter than this: # notifiers to be used in playbooks. date = str(datetime.datetime.now()) - print json.dumps({ + print(json.dumps({ "time" : date, "changed" : True - }) + })) sys.exit(0) # if no parameters are sent, the module may or @@ -171,9 +171,9 @@ a lot shorter than this: # return the time date = str(datetime.datetime.now()) - print json.dumps({ + print(json.dumps({ "time" : date - }) + })) Let's test that module:: diff --git a/docs/docsite/rst/dev_guide/developing_plugins.rst b/docs/docsite/rst/dev_guide/developing_plugins.rst index 977e126e82..9093f91243 100644 --- a/docs/docsite/rst/dev_guide/developing_plugins.rst +++ b/docs/docsite/rst/dev_guide/developing_plugins.rst @@ -84,6 +84,7 @@ Callback plugins are created by creating a new class with the Base(Callbacks) cl from ansible import constants as C class CallbackModule(CallbackBase): + pass From there, override the specific methods from the CallbackBase that you want to provide a callback for. For plugins intended for use with Ansible version 2.0 and later, you should only override methods that start with `v2`. For a complete list of methods that you can override, please see ``__init__.py`` in the `lib/ansible/plugins/callback `_ directory. diff --git a/docs/docsite/rst/playbooks_filters.rst b/docs/docsite/rst/playbooks_filters.rst index 2a6c38f205..eb69fbdaed 100644 --- a/docs/docsite/rst/playbooks_filters.rst +++ b/docs/docsite/rst/playbooks_filters.rst @@ -645,6 +645,7 @@ To always exhaust all list use ``zip_longest``:: .. versionadded:: 2.4 + To format a date using a string (like with the shell date command), use the "strftime" filter:: # Display year-month-day diff --git a/test/runner/requirements/constraints.txt b/test/runner/requirements/constraints.txt index df82f87dfc..2a64bb5c2a 100644 --- a/test/runner/requirements/constraints.txt +++ b/test/runner/requirements/constraints.txt @@ -1,3 +1,4 @@ coverage >= 4.2, != 4.3.2 # features in 4.2+ required, avoid known bug in 4.3.2 on python 2.6 pywinrm >= 0.2.1 # 0.1.1 required, but 0.2.1 provides better performance pylint >= 1.5.3, < 1.7.0 # 1.4.1 adds JSON output, but 1.5.3 fixes bugs related to JSON output +sphinx < 1.6 ; python_version < '2.7' # sphinx 1.6 and later require python 2.7 or later