diff --git a/README.rst b/README.rst index 5d03a2bd..9d63c97e 100644 --- a/README.rst +++ b/README.rst @@ -101,8 +101,11 @@ Release notes ---- * ``openstack-doc-test``: Output information about tested patch, - special case entity files for book building. + special case entity files for book building. Remove special handling + for high-availability-guide, it is not using asciidoc anymore. * New script in cleanup/retf for spell checking using the RETF rules. + patch. + 0.14 ---- diff --git a/os_doc_tools/doctest.py b/os_doc_tools/doctest.py index 07354ada..5046ff7b 100755 --- a/os_doc_tools/doctest.py +++ b/os_doc_tools/doctest.py @@ -284,24 +284,6 @@ def www_touched(check_only_www): return www_changed -def ha_guide_touched(): - """Check whether files in high-availability-guide directory are touched.""" - - try: - git_args = ["git", "diff", "--name-only", "HEAD~1", "HEAD"] - modified_files = check_output(git_args).strip().split() - except (subprocess.CalledProcessError, OSError) as e: - print("git failed: %s" % e) - sys.exit(1) - - ha_changed = False - for f in modified_files: - if f.startswith("doc/high-availability-guide/"): - ha_changed = True - - return ha_changed - - def check_modified_affects_all(rootdir): """Check whether special files were modified. @@ -821,19 +803,6 @@ def build_book(book, publish_path, log_path): ) # Success base_book = "install-guide (for Debian, Fedora, openSUSE, Ubuntu)" - elif base_book == "high-availability-guide": - # generatedocbook already calls build-ha-guide.sh, do not - # call it again here for translated languages. - if not cfg.CONF.language: - output = subprocess.check_output( - ["bash", os.path.join(SCRIPTS_DIR, - 'build-ha-guide.sh'), ], - stderr=subprocess.STDOUT - ) - output = subprocess.check_output( - ["mvn", "generate-sources", comments, release, "-B"], - stderr=subprocess.STDOUT - ) # Repository: identity-api elif (cfg.CONF.repo_name == "identity-api" and book.endswith("v3")): @@ -941,12 +910,6 @@ def find_affected_books(rootdir, book_exceptions, file_exceptions, if build_all_books: continue - # ha-guide uses asciidoc which we do not track. - # Just check whether any file is touched in that directory - if root.endswith('doc/high-availability-guide'): - if ha_guide_touched(): - affected_books.add(book_root) - for f in files: f_base = os.path.basename(f) f_abs = os.path.abspath(os.path.join(root, f)) diff --git a/os_doc_tools/handle_pot.py b/os_doc_tools/handle_pot.py index 01ec04a5..3e52d133 100644 --- a/os_doc_tools/handle_pot.py +++ b/os_doc_tools/handle_pot.py @@ -23,7 +23,6 @@ import codecs import optparse import os import shutil -import subprocess import sys import tempfile import xml.dom.minidom @@ -31,9 +30,6 @@ import xml.dom.minidom from xml2po import Main # noqa from xml2po.modes.docbook import docbookXmlMode # noqa -OS_DOC_TOOLS_DIR = os.path.dirname(__file__) -SCRIPTS_DIR = os.path.join(OS_DOC_TOOLS_DIR, 'scripts') - class myDocbookXmlMode(docbookXmlMode): def __init__(self): @@ -205,27 +201,8 @@ def generatedocbook(): if os.path.exists(destfolder): shutil.rmtree(destfolder) - # Build the XML original location first - if folder == 'high-availability-guide': - try: - curr = os.getcwd() - os.chdir(sourcepath) - subprocess.check_output( - ["bash", os.path.join(SCRIPTS_DIR, 'build-ha-guide.sh'), ], - stderr=subprocess.STDOUT - ) - os.chdir(curr) - except subprocess.CalledProcessError as e: - print("build-ha-guide.sh failed: %s" % e) - sys.exit(1) os.system("cp -r %s %s" % (sourcepath, destpath)) mergeback(folder, language, root) - # Somehow a lang="" is in the xml and breaks build, remove it - if folder == 'high-availability-guide': - bk_ha = os.path.join(destfolder, "bk-ha-guide.xml") - with open(bk_ha) as bk_ha_file: - newxml = bk_ha_file.read().replace('<book lang="" ', '<book ') - open(bk_ha, 'wb').write(newxml) def generatePoT(folder, root): diff --git a/os_doc_tools/scripts/build-ha-guide.sh b/os_doc_tools/scripts/build-ha-guide.sh deleted file mode 100755 index b96d70db..00000000 --- a/os_doc_tools/scripts/build-ha-guide.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# This script needs to be called from the doc/high-availibilty-guide -# directory! - -# Find location of db4-upgrade-xsl: -if [ -e /usr/share/xml/docbook/stylesheet/docbook5/db4-upgrade.xsl ] ; then - DB_UPGRADE=/usr/share/xml/docbook/stylesheet/docbook5/db4-upgrade.xsl -elif [ -e /usr/share/xml/docbook/stylesheet/upgrade/db4-upgrade.xsl ] ; then - DB_UPGRADE=/usr/share/xml/docbook/stylesheet/upgrade/db4-upgrade.xsl -else - echo "db4-upgrade.xsl not found" - exit 1 -fi - -type -P asciidoc > /dev/null 2>&1 || { echo >&2 "asciidoc not installed. Aborting."; exit 1; } -type -P xsltproc > /dev/null 2>&1 || { echo >&2 "xsltproc not installed. Aborting."; exit 1; } -type -P xmllint > /dev/null 2>&1 || { echo >&2 "xmllint not installed. Aborting."; exit 1; } - -asciidoc -b docbook -d book -o - ha-guide.txt | \ -xsltproc -o - $DB_UPGRADE - | \ -xmllint --format - | \ -sed -e 's,<book,<book xml:id="bk-ha-guide",' | \ -sed -e 's,<!-- Converted by db4-upgrade version 1.0 -->,,' |\ -sed -e 's,<info,<?rax pdf.url="../openstack-ha-guide-trunk.pdf"?><info,' \ - > bk-ha-guide.xml