From 7f2b19452fef440c4a2736222ffa370551e70d8c Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Thu, 9 Apr 2020 21:20:43 +0200 Subject: [PATCH] Cleanup py27 support and docs Make a few cleanups: - Remove obsolete sections from setup.cfg - Remove install_command from tox.ini, the default is fine - Switch to sphinx-build - Enable warnings for doc build, fix all warnings - Remove git handling from conf.py, openstackdocstheme does this now - Cleanup tox.ini Change-Id: I51796be20596afc2305c2d8ea189b4037bd28b2d --- doc/source/conf.py | 5 ----- requirements.txt | 2 +- setup.cfg | 11 ----------- specs/newton/api-containers-add-put.rst | 6 +++--- specs/newton/date-filters.rst | 6 +++--- specs/train/secret-consumers.rst | 21 +++++++++++++++------ tox.ini | 6 ++---- 7 files changed, 24 insertions(+), 33 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 089370c..397aca5 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -129,11 +129,6 @@ html_theme_options = {} # pixels large. #html_favicon = None -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -git_cmd = "git log --pretty=format:'%ad, commit %h' --date=local -n1" -html_last_updated_fmt = os.popen(git_cmd).read() - # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True diff --git a/requirements.txt b/requirements.txt index 144a2aa..6cf7c1c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -openstackdocstheme +openstackdocstheme>=1.32.1 sphinx!=2.1.0,>=2.0.0 stestr>2.0.0 # Apache-2.0 testtools>=0.9.34 diff --git a/setup.cfg b/setup.cfg index b8c2824..03e9c22 100644 --- a/setup.cfg +++ b/setup.cfg @@ -10,14 +10,3 @@ classifier = Intended Audience :: Developers License :: OSI Approved :: Apache Software License Operating System :: POSIX :: Linux - -[build_sphinx] -all_files = 1 -build-dir = doc/build -source-dir = doc/source - -[pbr] -warnerrors = True - -[wheel] -universal = 1 diff --git a/specs/newton/api-containers-add-put.rst b/specs/newton/api-containers-add-put.rst index aca1452..bc755ac 100644 --- a/specs/newton/api-containers-add-put.rst +++ b/specs/newton/api-containers-add-put.rst @@ -100,7 +100,7 @@ Request Attributes Request: ******** -.. code-block:: json +.. code-block:: none POST /v1/containers/{container_uuid}/secrets Headers: @@ -115,7 +115,7 @@ Request: Response: ********* -.. code-block:: json +.. code-block:: none { "container_ref": "https://{barbican_host}/v1/containers/{container_uuid}" @@ -150,7 +150,7 @@ containers. Request: ******** -.. code-block:: json +.. code-block:: none DELETE /v1/containers/{container_uuid}/secrets Headers: diff --git a/specs/newton/date-filters.rst b/specs/newton/date-filters.rst index 8adf0a8..887d9da 100644 --- a/specs/newton/date-filters.rst +++ b/specs/newton/date-filters.rst @@ -78,19 +78,19 @@ Examples: List secrets expiring in the next week (assuming current time is June 8, 2016 20:00 UTC) and sort by secrets expiring soonest: -.. code-block:: json +.. code-block:: none GET /v1/secrets?expiration=gt:2016-06-08T20:00:00Z,lt:2016-06-15T20:00:00Z&sort=expiration:asc List secrets created in the previous week assuming same current time as above: -.. code-block:: json +.. code-block:: none GET /v1/secrets?created=gt:2016-06-01T20:00:00Z,lt:2016-06-08T20:00:00Z List secrets updated in the previous week assuming same current time as above: -.. code-block:: json +.. code-block:: none GET /v1/secrets?updated=gt:2016-06-01T20:00:00Z,lt:2016-06-08T20:00:00Z diff --git a/specs/train/secret-consumers.rst b/specs/train/secret-consumers.rst index 7d07648..3c771df 100644 --- a/specs/train/secret-consumers.rst +++ b/specs/train/secret-consumers.rst @@ -111,6 +111,8 @@ the resrouce_id refers to an image. Request +++++++ +:: + POST /v1/secrets/{secret_id}/consumers Headers: X-Auth-Token: {token} @@ -157,6 +159,8 @@ Parameters Request +++++++ +:: + GET /v1/secrets/{secret_id}/consumers Headers: X-Auth-Token: {token} @@ -164,6 +168,9 @@ Request OK Response +++++++++++ +:: + + 200 OK { @@ -198,6 +205,8 @@ to access this secret. Request +++++++ +:: + DELETE v1/secrets/{secret_id}/consumers/{resource_id} Responses @@ -222,7 +231,7 @@ Security impact Because the consumers are stored in the database, there is the possibility that a bad actor could add many consumers to try to fill the database disk space. Secret Consumers should be limited to the same quota as Container -Consumers to mitigate this risk. For example: +Consumers to mitigate this risk. For example:: [quota] quota_consumers=10000 @@ -239,7 +248,7 @@ Python and Command Line Client Impact ------------------------------------- The Secret class in python-barbicanclient should be updated to add new -methods such as: +methods such as:: class Secret(...): ... @@ -253,7 +262,7 @@ methods such as: Both methods should raise appropriate exceptions when the API returns an error. Additionally, the Secret.delete() method should be updated to take a new *force* parameter and throw an exception when delete() is called with force=False, -and the secret still has consumers: +and the secret still has consumers:: class Secret(...): ... @@ -261,7 +270,7 @@ and the secret still has consumers: def delete(self, force=False): ... -The CLI client should be changed to add new consumer options, such as: +The CLI client should be changed to add new consumer options, such as:: openstack secret consumer add --service-type=image --resource-type=image \ --resource-id=XXXX-XXXX-XXXX-XXXX @@ -269,12 +278,12 @@ The CLI client should be changed to add new consumer options, such as: openstack secret consumer remove --service-type=image --resource-type=image \ --resource-id=XXXX-XXXX-XXXX-XXXX -The secret delete command should be changed to take a *--force* parameter: +The secret delete command should be changed to take a *--force* parameter:: openstack secret delete --force {secret_uuid} This command should return an error when a secret has one or more consumers -and the --force flag is not used: +and the --force flag is not used:: openstack secret delete {secret_uuid_with_consumers} ERROR: Secret has one or more consumers. Use --force to delete anyway. diff --git a/tox.ini b/tox.ini index 71f29e1..23252e8 100644 --- a/tox.ini +++ b/tox.ini @@ -4,15 +4,13 @@ envlist = docs skipsdist = True [testenv] +basepython = python3 usedevelop = True setenv = VIRTUAL_ENV={envdir} -install_command = pip install -U {opts} {packages} deps = -r{toxinidir}/requirements.txt [testenv:venv] -basepython = python3 commands = {posargs} [testenv:docs] -basepython = python3 -commands = python setup.py build_sphinx +commands = sphinx-build -W -b html doc/source doc/build/html