diff --git a/devstack/distros/oneiric.py b/devstack/distros/oneiric.py index f15cacc8..bfa7ea32 100644 --- a/devstack/distros/oneiric.py +++ b/devstack/distros/oneiric.py @@ -33,7 +33,7 @@ LOG = logging.getLogger(__name__) class DBInstaller(db.DBInstaller): def _configure_db_confs(self): - LOG.info("Fixing up %s mysql configs.", self.distro.name) + LOG.info("Fixing up %r mysql configs.", self.distro.name) fc = sh.load_file('/etc/mysql/my.cnf') lines = fc.splitlines() new_lines = list() @@ -52,7 +52,7 @@ class RabbitPackager(apt.AptPackager): #https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/+bug/878597 #https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/+bug/878600 name = pkg['name'] - LOG.debug("Handling special remove of %s." % (name)) + LOG.debug("Handling special remove of %r" % (name)) pkg_full = self._format_pkg_name(name, pkg.get("version")) cmd = apt.APT_REMOVE + [pkg_full] self._execute_apt(cmd) @@ -67,7 +67,7 @@ class RabbitPackager(apt.AptPackager): #https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/+bug/878597 #https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/+bug/878600 name = pkg['name'] - LOG.debug("Handling special install of %s." % (name)) + LOG.debug("Handling special install of %r" % (name)) #this seems to be a temporary fix for that bug with tempfile.TemporaryFile() as f: pkg_full = self._format_pkg_name(name, pkg.get("version")) diff --git a/devstack/distros/rhel6.py b/devstack/distros/rhel6.py index e4045305..4f1ce13c 100644 --- a/devstack/distros/rhel6.py +++ b/devstack/distros/rhel6.py @@ -50,7 +50,7 @@ DEF_IDENT = 'unix-group:libvirtd' class DBInstaller(db.DBInstaller): def _configure_db_confs(self): - LOG.info("Fixing up %s mysql configs.", self.distro.name) + LOG.info("Fixing up %r mysql configs.", self.distro.name) fc = sh.load_file('/etc/my.cnf') lines = fc.splitlines() new_lines = list() @@ -69,7 +69,7 @@ class HorizonInstaller(horizon.HorizonInstaller): (user, group) = self._get_apache_user_group() # This is recorded so it gets cleaned up during uninstall self.tracewriter.file_touched(SOCKET_CONF) - LOG.info("Fixing up %s and %s files" % (SOCKET_CONF, HTTPD_CONF)) + LOG.info("Fixing up %r and %r files" % (SOCKET_CONF, HTTPD_CONF)) with sh.Rooted(True): # Fix the socket prefix to someplace we can use fc = "WSGISocketPrefix %s" % (sh.joinpths(self.log_dir, "wsgi-socket")) diff --git a/devstack/packager.py b/devstack/packager.py index 862c1e63..7210148b 100644 --- a/devstack/packager.py +++ b/devstack/packager.py @@ -47,13 +47,13 @@ class Packager(object): def pre_install(self, pkg, params=None): cmds = pkg.get('pre-install') if cmds: - LOG.info("Running pre-install commands for package %s.", + LOG.info("Running pre-install commands for package %r.", pkg['name']) utils.execute_template(*cmds, params=params) def post_install(self, pkg, params=None): cmds = pkg.get('post-install') if cmds: - LOG.info("Running post-install commands for package %s.", + LOG.info("Running post-install commands for package %r.", pkg['name']) utils.execute_template(*cmds, params=params) diff --git a/devstack/pip.py b/devstack/pip.py index 4bb52150..57d85360 100644 --- a/devstack/pip.py +++ b/devstack/pip.py @@ -33,7 +33,7 @@ def _make_pip_name(name, version): def install(pip, distro): name = pip['name'] root_cmd = distro.get_command_config('pip') - LOG.audit("Installing python package (%s) using pip command (%s)" % (name, root_cmd)) + LOG.audit("Installing python package %r using pip command %s" % (name, root_cmd)) name_full = _make_pip_name(name, pip.get('version')) real_cmd = [root_cmd, 'install'] + PIP_INSTALL_CMD_OPTS options = pip.get('options') @@ -49,12 +49,12 @@ def uninstall(pip, distro, skip_errors=True): try: # Versions don't seem to matter here... name = _make_pip_name(pip['name'], None) - LOG.audit("Uninstalling python package (%s) using pip command (%s)" % (name, root_cmd)) + LOG.audit("Uninstalling python package %r using pip command %s" % (name, root_cmd)) cmd = [root_cmd, 'uninstall'] + PIP_UNINSTALL_CMD_OPTS + [name] sh.execute(*cmd, run_as_root=True) except excp.ProcessExecutionError: if skip_errors: - LOG.debug(("Ignoring execution error that occured when uninstalling pip %s!" + LOG.debug(("Ignoring execution error that occured when uninstalling pip %r!" " (this may be ok if it was uninstalled by a previous component)") % (name)) else: raise diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000..dda9bfc7 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,130 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + -rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/FubuMVC.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/FubuMVC.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/FubuMVC" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/FubuMVC" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + make -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." diff --git a/docs/source/img/logo.jpg b/docs/source/img/logo.jpg new file mode 100644 index 00000000..6cf850ec Binary files /dev/null and b/docs/source/img/logo.jpg differ diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 00000000..048afbc7 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,98 @@ +|DEVSTACKpy| is a set of **python** scripts and utilities to quickly +deploy an OpenStack cloud. + +It is meant to be a full re-write of `DEVSTACK`_ which adds more +developer features (it is **not** meant to be a full deployment +system!). + +Index +===== + +- `Beginners guide`_ +- `Examples`_ +- `Bugs, hugs and code`_ +- `Q+A`_ +- `Solved problems/workarounds`_ +- Advanced + + - `Hacking`_ + - `Adding your own distro`_ + - `Adding your own persona`_ + - `Design details`_ + - `Known issues`_ + +Goals +===== + +- To aid developers getting involved with OpenStack! +- To quickly build developer OpenStack environments in a clean + environment (as well as start, stop, and uninstall those + environments) with as little baggage as possible. +- To describe working configurations of OpenStack. + + - Which code branches work together? + - What do config files look like for those branches? + - What packages are needed for installation for a given + distribution? + +- To make it easier for developers to dive into OpenStack so that they + can productively contribute without having to understand every part + of the system at once. +- To make it easy to prototype cross-project features. + +Features +======== + +- Supports more than one distribution. +- Currently RHEL 6.2 (with `epel`_), Ubuntu 11.10, Fedora 16 +- Supports dry-run mode (to see what *would* happen) +- Supports varying installation *personas* +- See ``conf/personas/devstack.sh.yaml`` +- A single ``stack.ini`` file that shows configuration used +- Supports install/uninstall/starting/stopping of OpenStack components. +- In various styles (daemonizing via `forking`_, `screen`_, `upstart`_) +- Written in python so it matches the style of other OpenStack + components. +- Extensively documented distribution specifics +- Packages and pip (with versions known to work!) dependencies +- Any needed distribution specific actions (ie service names…) +- See ``conf/distros`` +- Follows standard software development practices (for everyones + sanity). +- Functions, classes, objects and more (oh my!) +- Still *readable* by someone with limited python knowledge. +- The ability to be unit-tested! + +Important! +========== + +**Warning:** Be sure to carefully read ``stack`` and any other scripts +you execute before you run them, as they install software and may alter +your networking configuration. We strongly recommend that you run +``stack`` in a clean and disposable virtual machine when you are first +getting started. + +.. _DEVSTACK: http://devstack.org/ +.. _Beginners +guide: https://github.com/yahoo/Openstack-DevstackPy/wiki/Simple-Setup +.. _Examples: https://github.com/yahoo/Openstack-DevstackPy/wiki/Examples +.. _Bugs, hugs and +code: https://github.com/yahoo/Openstack-DevstackPy/wiki/Bugs,-Hugs +.. _Q+A: https://github.com/yahoo/Openstack-DevstackPy/wiki/Questions-and-answers +.. _Solved +problems/workarounds: https://github.com/yahoo/Openstack-DevstackPy/wiki/Problems-Solved +.. _Hacking: https://github.com/yahoo/Openstack-DevstackPy/blob/master/HACKING.md +.. _Adding your own +distro: https://github.com/yahoo/Openstack-DevstackPy/wiki/Adding-a-new-distro. +.. _Adding your own +persona: https://github.com/yahoo/Openstack-DevstackPy/wiki/Adding-a-new-persona. +.. _Design +details: https://github.com/yahoo/Openstack-DevstackPy/wiki/Advanced +.. _Known +issues: https://github.com/yahoo/Openstack-DevstackPy/wiki/Known-issues +.. _epel: http://fedoraproject.org/wiki/EPEL +.. _forking: http://users.telenet.be/bartl/classicperl/fork/all.html +.. _screen: http://www.manpagez.com/man/1/screen/ +.. _upstart: http://upstart.ubuntu.com/ + +.. |DEVSTACKpy| image:: http://farm8.staticflickr.com/7188/6821923128_35e84f868f_t.jpg