Merge "Final changes for pike RC1"

This commit is contained in:
Jenkins 2017-08-10 20:45:42 +00:00 committed by Gerrit Code Review
commit 4a9566adf6
15 changed files with 6490 additions and 12 deletions

View File

@ -207,11 +207,18 @@ class LibraryService (data_service.DataService):
for (dirpath, dirnames, filenames) in os.walk(
cfg.CONF.policy_library_path):
for filename in filenames:
count = _load_library_policy_file(
os.path.join(dirpath, filename))
if count > 0:
file_count += 1
policy_count += count
name, extension = os.path.splitext(filename)
if extension in ['.yaml', '.yml']:
fullpath = os.path.join(dirpath, filename)
count = 0
try:
count = _load_library_policy_file(fullpath)
except Exception:
LOG.exception('Failed to load library policy file %s',
fullpath)
if count > 0:
file_count += 1
policy_count += count
LOG.debug(
'%s library policies from %s files successfully loaded',
policy_count, file_count)

View File

@ -26,6 +26,8 @@ extensions = [
'sphinx.ext.todo',
'openstackdocstheme',
#'sphinx.ext.intersphinx',
'oslo_config.sphinxext',
'oslo_config.sphinxconfiggen',
]
# openstackdocstheme options
@ -65,7 +67,7 @@ modindex_common_prefix = ['congress.']
# Sphinx are currently 'default' and 'sphinxdoc'.
# html_theme_path = ["."]
html_theme = 'openstackdocs'
# html_static_path = ['static']
html_static_path = ['_static']
# Output file base name for HTML help builder.
htmlhelp_basename = '%sdoc' % project
@ -85,6 +87,10 @@ latex_documents = [
# Example configuration for intersphinx: refer to the Python standard library.
#intersphinx_mapping = {'http://docs.python.org/': None}
# -- Options for oslo_config.sphinxconfiggen ---------------------------------
config_generator_config_file = '../../etc/congress-config-generator.conf'
sample_config_basename = '_static/congress'
[extensions]
todo_include_todos=True

View File

@ -0,0 +1,6 @@
=============
congress.conf
=============
.. show-options::
:config-file: etc/congress-config-generator.conf

View File

@ -0,0 +1,30 @@
=====================
Configuration Options
=====================
This section provides a list of all possible options for each
configuration file.
Configuration Reference
-----------------------
Congress uses the following configuration files.
.. toctree::
:glob:
:maxdepth: 1
*
Sample Configuration Files
--------------------------
The following are sample configuration files for Congress.
These are generated from code and reflect the current state of code
in the Congress repository.
.. toctree::
:glob:
:maxdepth: 1
samples/*

View File

@ -0,0 +1,8 @@
====================
Sample congress.conf
====================
This sample configuration can also be viewed in `the raw format
<../../_static/congress.conf.sample>`_.
.. literalinclude:: ../../_static/congress.conf.sample

View File

@ -12,6 +12,7 @@ Welcome to Congress!
Introduction <user/readme>
User Documentation <user/index>
Installation Documentation <install/index>
Configuration Documentation <configuration/index>
Administrator Documentation <admin/index>
Contributor Documentation <contributor/index>

View File

@ -9,6 +9,7 @@ Congress User Documentation
cloudservices
policy
enforcement
policy-library
api
tutorial-tenant-sharing

View File

@ -0,0 +1,4 @@
.. _policy-library:
.. include:: ../../../library/README.rst

21
library/README.rst Normal file
View File

@ -0,0 +1,21 @@
==============
Policy Library
==============
Congress bundles a library of useful policies to help users get started.
For example, the ``library/volume_encryption/servers_unencrypted_volume.yaml``
identifies and warns on servers with unencrypted volumes attached.
.. literalinclude:: ../../../library/volume_encryption/servers_unencrypted_volume.yaml
The latest collection library policies can be found here:
https://github.com/openstack/congress/tree/master/library
To import a library policy YAML file into Congress, use the following CLI
command (python-congressclient version 1.8.0 or higher
https://pypi.python.org/pypi/python-congressclient/).
.. code-block:: console
$ openstack congress policy create-from-file <path-to-policy-yaml>

View File

@ -10,5 +10,4 @@ upgrade:
Congress will load pre-written policies for easy activation later
by an administrator.
This option can be ignored if you do not want
Congress to load pre-written policies from files. Due to MySQL limitations,
the full path to each policy file cannot exceed 760 characters.
Congress to load pre-written policies from files.

View File

@ -0,0 +1,20 @@
++./doctor_pushdriver.sh:main:13 sed -n 5p
++./doctor_pushdriver.sh:main:13 openstack congress datasource create doctor doctor -f value
+./doctor_pushdriver.sh:main:13 UUID=e16aca11-caa7-44ed-a4f8-95af4a3b9f6a
+./doctor_pushdriver.sh:main:15 openstack congress datasource row update doctor events '[{"id": "0123-4567-89ab", "time": "2016-02-22T11:48:55Z", "type": "compute.host.down", "details": {"hostname": "compute1", "status": "down", "monitor": "zabbix1", "monitor_event_id": "111"}}]'
+./doctor_pushdriver.sh:main:17 openstack congress datasource row list doctor events
+---------------+---------------+----------+--------+---------+------------------+
| time | type | hostname | status | monitor | monitor_event_id |
+---------------+---------------+----------+--------+---------+------------------+
| 2016-02-22T11 | compute.host. | compute1 | down | zabbix1 | 111 |
| :48:55Z | down | | | | |
+---------------+---------------+----------+--------+---------+------------------+
+./doctor_pushdriver.sh:main:19 openstack congress datasource row update e16aca11-caa7-44ed-a4f8-95af4a3b9f6a events '[{"id": "1123-4567-89ab", "time": "2016-02-22T11:48:55Z", "type": "compute.host.down", "details": {"hostname": "compute2", "status": "down", "monitor": "zabbix2", "monitor_event_id": "222"}}]'
+./doctor_pushdriver.sh:main:21 openstack congress datasource row list doctor events
+---------------+---------------+----------+--------+---------+------------------+
| time | type | hostname | status | monitor | monitor_event_id |
+---------------+---------------+----------+--------+---------+------------------+
| 2016-02-22T11 | compute.host. | compute2 | down | zabbix2 | 222 |
| :48:55Z | down | | | | |
+---------------+---------------+----------+--------+---------+------------------+
+./doctor_pushdriver.sh:main:23 openstack congress datasource delete doctor

View File

@ -12,7 +12,7 @@
#############################################################################
openstack congress version list
UUID=`openstack congress datasource create --config username=admin --config tenant_name=admin --config auth_url=http://127.0.0.1:5000/v3 --config password=password --config poll_time=5 nova nova2 -f value | sed -n '5p'`
UUID=`openstack congress datasource create --config username=admin --config tenant_name=admin --config auth_url=http://127.0.0.1/identity --config password=password --config poll_time=5 nova nova2 -f value | sed -n '5p'`
openstack congress datasource actions show nova2
openstack congress datasource actions show $UUID
openstack congress datasource list
@ -94,7 +94,7 @@ openstack congress policy row list policy1 s
# TODO make action undoable. undo.
openstack congress datasource delete nova
UUID=`openstack congress datasource create --config username=admin --config tenant_name=admin --config auth_url=http://127.0.0.1:5000/v3 --config password=password --config poll_time=5 nova nova -f value | sed -n '5p'`
UUID=`openstack congress datasource create --config username=admin --config tenant_name=admin --config auth_url=http://127.0.0.1/identity --config password=password --config poll_time=5 nova nova -f value | sed -n '5p'`
openstack congress datasource row list nova flavors
openstack congress policy rule create policy1 'q(10,10)'
openstack congress policy row list policy1 s # 0 tuples, could take a little time to realize

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@ description-file =
README.rst
author = OpenStack
author-email = openstack-dev@lists.openstack.org
home-page = http://docs.openstack.org/developer/congress/
home-page = https://docs.openstack.org/congress/latest/
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology