Remove Docbook conversion in tox for HA Guide

The High Availability Guide is currently written in ASCIIdoc, so
the tox scripts have to convert it to Docbook before continuing to
test. Remove all special casing needed for this.

Co-Authored-By: Andreas Jaeger <aj@suse.com>
Change-Id: I5a6c13e502d003237eb93d27028de2cb9db02e04
Implements: blueprint convert-ha-guide-to-docbook
This commit is contained in:
Nicholas Chase 2014-05-26 01:08:16 -04:00 committed by Andreas Jaeger
parent 5527d8d1a4
commit 3cfe0a3fdf
4 changed files with 4 additions and 87 deletions

View File

@ -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
----

View File

@ -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))

View File

@ -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):

View File

@ -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