added: environment file with global parameters for setup and docs

This commit is contained in:
adobdin 2016-05-28 17:28:25 +00:00
parent 681ea56fc1
commit 4addc5b489
7 changed files with 23 additions and 13 deletions

View File

@ -15,6 +15,7 @@
import sys
import os
import shlex
from timmy.env import version, project_name
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
@ -51,7 +52,7 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
project = u'timmy'
project = project_name
#copyright = u'2015, Mirantis'
author = u'Mirantis'
@ -60,9 +61,9 @@ author = u'Mirantis'
# built documents.
#
# The short X.Y version.
version = u'0.1'
version = version
# The full version, including alpha/beta/rc tags.
release = u'0.1'
release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View File

@ -1,6 +1,6 @@
=======
=============
Specification
=======
=============
* The tool is based on https://etherpad.openstack.org/p/openstack-diagnostics

View File

@ -1,6 +1,6 @@
=============
============
Tools module
=============
============
.. automodule:: timmy.tools
:members:

View File

@ -26,18 +26,18 @@ Basic parameters:
Shell mode - rqfile (``rq.yaml`` by default) is skipped, Fuel node is skipped, outputs of commands (specified with ``-C`` options) and scripts (specified with ``-S``) are printed on screen.
=====
========
Examples
=====
========
* ``timmy -C 'uptime; free -m'`` - check uptime and memory on all nodes
* ``timmy -G /etc/nova/nova.conf`` - get nova.conf from all nodes
* ``timmy -R controller -P package.deb '' -C 'dpkg -i package.deb' -C 'rm package.deb' -C 'dpkg -l | grep [p]ackage'`` - push a package to all nodes, install it, remove the file and check that it is installed
* ``timmy -с myconf.yaml`` - use a custom config file and run according to it
=====
===============================
Using custom configuration file
=====
===============================
If you want to do a set of actions on the nodes and you do not want to write a long command line (or you want to use options only available in config), you may want to set up config file instead. An example config structure would be:

View File

@ -2,15 +2,16 @@
from setuptools import setup
import os
from timmy.env import project_name, version
pname = 'timmy'
pname = project_name
dtm = os.path.join(os.path.abspath(os.sep), 'usr', 'share', pname)
rqfiles = [(os.path.join(dtm, root), [os.path.join(root, f) for f in files])
for root, dirs, files in os.walk('rq')]
rqfiles.append((os.path.join(dtm, 'configs'), ['config.yaml', 'rq.yaml']))
setup(name=pname,
version='1.2.0',
version=version,
author="Aleksandr Dobdin",
author_email='dobdin@gmail.com',
license='Apache2',

View File

@ -15,7 +15,9 @@
# under the License.
# Builds a Sphinx documentation
rm -rf doc/build/
sphinx-build -b html doc/source/ doc/build/
rm -f ./*.pyc
rm -f ./timmy/*.pyc

6
timmy/env.py Normal file
View File

@ -0,0 +1,6 @@
project_name = 'timmy'
version = '1.2.0'
if __name__ == '__main__':
exit(0)