Compare commits
28 Commits
train-eol
...
victoria-e
| Author | SHA1 | Date | |
|---|---|---|---|
| f170e7715e | |||
| 7c56285603 | |||
|
|
80f728b14f | ||
|
|
2e97950670 | ||
|
|
21b106dc15 | ||
|
|
7213f7195e | ||
|
|
21f42884f1 | ||
|
|
4c57d61f8d | ||
|
|
e05b498a5f | ||
|
|
8d3ce6c58d | ||
|
|
bb7af48350 | ||
|
|
92c15fa38a | ||
|
|
d3cc035ff7 | ||
|
|
fb22d3e1f8 | ||
| ac0ccb67a6 | |||
|
|
5946fbb5b1 | ||
|
|
2830afdc75 | ||
|
|
1912b9aa82 | ||
|
|
1f9194ced5 | ||
|
|
9387369cd7 | ||
|
|
431319ee4d | ||
|
|
e3c903cfce | ||
|
|
e3f0a3d2b5 | ||
|
|
88351df1c2 | ||
|
|
df3ec7849e | ||
|
|
0c7e306642 | ||
|
|
db70063cee | ||
|
|
1d1f28a256 |
@@ -2,4 +2,4 @@
|
||||
host=review.opendev.org
|
||||
port=29418
|
||||
project=openstack/python-watcherclient.git
|
||||
defaultbranch=stable/train
|
||||
defaultbranch=stable/victoria
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
templates:
|
||||
- openstack-cover-jobs
|
||||
- openstack-lower-constraints-jobs
|
||||
- openstack-python-jobs
|
||||
- openstack-python3-train-jobs
|
||||
- openstack-python3-victoria-jobs
|
||||
- publish-openstack-docs-pti
|
||||
- check-requirements
|
||||
- openstackclient-plugin-jobs
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# of appearance. Changing the order has an impact on the overall integration
|
||||
# process, which may cause wedges in the gate later.
|
||||
|
||||
openstackdocstheme>=1.18.1 # Apache-2.0
|
||||
sphinx!=1.6.6,!=1.6.7,>=1.6.5,<2.0.0;python_version=='2.7' # BSD
|
||||
sphinx!=1.6.6,!=1.6.7,>=1.6.5;python_version>='3.4' # BSD
|
||||
openstackdocstheme>=2.2.1 # Apache-2.0
|
||||
sphinx>=2.0.0,!=2.1.0 # BSD
|
||||
sphinxcontrib-apidoc>=0.2.0 # BSD
|
||||
|
||||
|
||||
@@ -620,38 +620,43 @@ Create new audit template.
|
||||
``--scope <path>``
|
||||
Part of the cluster on which an audit will be done.
|
||||
Can be provided either in yaml or json file.
|
||||
YAML example:
|
||||
---- host_aggregates:
|
||||
- id: 1
|
||||
- id: 2
|
||||
- id: 3
|
||||
|
||||
YAML example:
|
||||
::
|
||||
|
||||
---
|
||||
- host_aggregates:
|
||||
- id: 1
|
||||
- id: 2
|
||||
- id: 3
|
||||
- availability_zones:
|
||||
- name: AZ1
|
||||
- name: AZ2
|
||||
- name: AZ1
|
||||
- name: AZ2
|
||||
- exclude:
|
||||
- instances:
|
||||
- uuid: UUID1
|
||||
- uuid: UUID2
|
||||
- compute_nodes:
|
||||
- name: compute1
|
||||
|
||||
JSON example:
|
||||
[{'host_aggregates': [
|
||||
{'id': 1},
|
||||
{'id': 2},
|
||||
{'id': 3}]},
|
||||
{'availability_zones': [
|
||||
{'name': 'AZ1'},
|
||||
{'name': 'AZ2'}]},
|
||||
{'exclude': [
|
||||
{'instances': [
|
||||
{'uuid': 'UUID1'},
|
||||
{'uuid': 'UUID2'}
|
||||
]},
|
||||
{'compute_nodes': [
|
||||
{'name': 'compute1'}
|
||||
]}
|
||||
]}]
|
||||
- instances:
|
||||
- uuid: UUID1
|
||||
- uuid: UUID2
|
||||
- compute_nodes:
|
||||
- name: compute1
|
||||
|
||||
JSON example:
|
||||
::
|
||||
|
||||
[
|
||||
{'host_aggregates': [
|
||||
{'id': 1},
|
||||
{'id': 2},
|
||||
{'id': 3}]},
|
||||
{'availability_zones': [
|
||||
{'name': 'AZ1'},
|
||||
{'name': 'AZ2'}]},
|
||||
{'exclude': [
|
||||
{'instances': [
|
||||
{'uuid': 'UUID1'},
|
||||
{'uuid': 'UUID2'}]},
|
||||
{'compute_nodes': [
|
||||
{'name': 'compute1'}]}]}
|
||||
]
|
||||
|
||||
.. _watcher_audittemplate_delete:
|
||||
|
||||
|
||||
@@ -12,20 +12,26 @@
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
from watcherclient import version as watcherclient_version
|
||||
|
||||
# -- General configuration ----------------------------------------------------
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||
extensions = ['sphinx.ext.autodoc',
|
||||
'sphinx.ext.viewcode',
|
||||
'sphinxcontrib.apidoc',
|
||||
'openstackdocstheme',
|
||||
]
|
||||
# autodoc generation is a bit aggressive and a nuisance when doing heavy
|
||||
# text edit cycles.
|
||||
# execute "export SPHINX_DEBUG=1" in your terminal to disable
|
||||
|
||||
# sphinxcontrib.apidoc options
|
||||
apidoc_module_dir = '../../watcherclient'
|
||||
apidoc_output_dir = 'reference/api'
|
||||
apidoc_excluded_paths = [
|
||||
'tests/*']
|
||||
apidoc_separate_modules = True
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
@@ -39,16 +45,6 @@ master_doc = 'index'
|
||||
project = u'python-watcherclient'
|
||||
copyright = u'OpenStack Foundation'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = watcherclient_version.version_info.release_string()
|
||||
# The short X.Y version.
|
||||
version = watcherclient_version.version_info.version_string()
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
modindex_common_prefix = ['watcherclient.']
|
||||
|
||||
@@ -60,7 +56,7 @@ add_function_parentheses = True
|
||||
add_module_names = True
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
pygments_style = 'native'
|
||||
|
||||
# -- Options for HTML output --------------------------------------------------
|
||||
|
||||
@@ -88,12 +84,22 @@ latex_documents = [
|
||||
),
|
||||
]
|
||||
|
||||
# openstackdocstheme options
|
||||
repository_name = 'openstack/python-watcherclient'
|
||||
bug_project = 'python-watcherclient'
|
||||
bug_tag = ''
|
||||
# Disable usage of xindy https://bugzilla.redhat.com/show_bug.cgi?id=1643664
|
||||
latex_use_xindy = False
|
||||
|
||||
latex_domain_indices = False
|
||||
|
||||
latex_elements = {
|
||||
'makeindex': '',
|
||||
'printindex': '',
|
||||
'preamble': r'\setcounter{tocdepth}{3}',
|
||||
}
|
||||
|
||||
# openstackdocstheme options
|
||||
openstackdocs_repo_name = 'openstack/python-watcherclient'
|
||||
openstackdocs_pdf_link = True
|
||||
openstackdocs_bug_project = 'python-watcherclient'
|
||||
openstackdocs_bug_tag = ''
|
||||
|
||||
# Must set this variable to include year, month, day, hours, and minutes.
|
||||
html_last_updated_fmt = '%Y-%m-%d %H:%M'
|
||||
|
||||
#html_theme_options = {"show_other_versions": "True"}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
======================
|
||||
Python API Reference
|
||||
======================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
autoindex
|
||||
@@ -10,5 +10,5 @@ done so, you can use the API like so.
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
api/index
|
||||
api/modules
|
||||
api_v1
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
alabaster==0.7.10
|
||||
appdirs==1.4.3
|
||||
asn1crypto==0.23.0
|
||||
Babel==2.5.3
|
||||
certifi==2018.1.18
|
||||
cffi==1.7.0
|
||||
cffi==1.14.0
|
||||
chardet==3.0.4
|
||||
cliff==2.11.0
|
||||
cmd2==0.8.2
|
||||
coverage==4.0
|
||||
cryptography==2.1
|
||||
cryptography==2.7
|
||||
debtcollector==1.19.0
|
||||
decorator==4.2.1
|
||||
deprecation==2.0
|
||||
@@ -19,7 +18,6 @@ extras==1.0.0
|
||||
fasteners==0.7.0
|
||||
fixtures==3.0.0
|
||||
flake8==2.5.5
|
||||
future==0.16.0
|
||||
hacking==0.12.0
|
||||
idna==2.6
|
||||
imagesize==0.7.1
|
||||
@@ -33,14 +31,11 @@ keystoneauth1==3.4.0
|
||||
linecache2==1.0.0
|
||||
MarkupSafe==1.0
|
||||
mccabe==0.2.1
|
||||
mock==2.0.0
|
||||
monotonic==1.4
|
||||
mox3==0.20.0
|
||||
msgpack-python==0.4.0
|
||||
munch==2.2.0
|
||||
netaddr==0.7.19
|
||||
netifaces==0.10.6
|
||||
openstackdocstheme==1.18.1
|
||||
openstacksdk==0.12.0
|
||||
os-client-config==1.29.0
|
||||
os-service-types==1.2.0
|
||||
@@ -69,15 +64,13 @@ python-dateutil==2.5.3
|
||||
python-mimeparse==1.6.0
|
||||
python-subunit==1.0.0
|
||||
pytz==2018.3
|
||||
PyYAML==3.12
|
||||
PyYAML==3.13
|
||||
requests==2.18.4
|
||||
requestsexceptions==1.4.0
|
||||
rfc3986==0.3.1
|
||||
simplejson==3.13.2
|
||||
six==1.11.0
|
||||
snowballstemmer==1.2.1
|
||||
Sphinx==1.6.5
|
||||
sphinxcontrib-websupport==1.0.1
|
||||
stestr==2.0.0
|
||||
stevedore==1.28.0
|
||||
tempest==17.1.0
|
||||
|
||||
6
releasenotes/notes/drop-py-2-7-f7078b44cf99cae1.yaml
Normal file
6
releasenotes/notes/drop-py-2-7-f7078b44cf99cae1.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
upgrade:
|
||||
- |
|
||||
Python 2.7 support has been dropped. Last release of python-watcherclient
|
||||
to support py2.7 is OpenStack Train. The minimum version of Python now
|
||||
supported by python-watcherclient is Python 3.6.
|
||||
@@ -2,7 +2,6 @@
|
||||
# of appearance. Changing the order has an impact on the overall integration
|
||||
# process, which may cause wedges in the gate later.
|
||||
|
||||
Babel!=2.4.0,>=2.5.3 # BSD
|
||||
cliff!=2.9.0,>=2.11.0 # Apache-2.0
|
||||
osc-lib>=1.10.0 # Apache-2.0
|
||||
oslo.i18n>=3.20.0 # Apache-2.0
|
||||
@@ -11,4 +10,4 @@ oslo.utils>=3.36.0 # Apache-2.0
|
||||
pbr!=2.1.0,>=3.1.1 # Apache-2.0
|
||||
keystoneauth1>=3.4.0 # Apache-2.0
|
||||
six>=1.11.0 # MIT
|
||||
PyYAML>=3.12 # MIT
|
||||
PyYAML>=3.13 # MIT
|
||||
|
||||
27
setup.cfg
27
setup.cfg
@@ -6,6 +6,7 @@ description-file =
|
||||
author = OpenStack
|
||||
author-email = openstack-discuss@lists.openstack.org
|
||||
home-page = https://docs.openstack.org/python-watcherclient/latest/
|
||||
python-requires = >=3.6
|
||||
classifier =
|
||||
Environment :: OpenStack
|
||||
Intended Audience :: Information Technology
|
||||
@@ -13,11 +14,10 @@ classifier =
|
||||
License :: OSI Approved :: Apache Software License
|
||||
Operating System :: POSIX :: Linux
|
||||
Programming Language :: Python
|
||||
Programming Language :: Python :: 2
|
||||
Programming Language :: Python :: 2.7
|
||||
Programming Language :: Python :: 3
|
||||
Programming Language :: Python :: 3.6
|
||||
Programming Language :: Python :: 3.7
|
||||
Programming Language :: Python :: 3.8
|
||||
|
||||
[files]
|
||||
packages =
|
||||
@@ -113,26 +113,3 @@ autodoc_index_modules = True
|
||||
autodoc_exclude_modules =
|
||||
watcherclient.tests.*
|
||||
api_doc_dir = reference/api
|
||||
|
||||
[build_sphinx]
|
||||
source-dir = doc/source
|
||||
build-dir = doc/build
|
||||
all_files = 1
|
||||
warning-is-error = 1
|
||||
|
||||
[bdist_wheel]
|
||||
universal = 1
|
||||
|
||||
[compile_catalog]
|
||||
directory = watcherclient/locale
|
||||
domain = watcherclient
|
||||
|
||||
[update_catalog]
|
||||
domain = watcherclient
|
||||
output_dir = watcherclient/locale
|
||||
input_file = watcherclient/locale/watcherclient.pot
|
||||
|
||||
[extract_messages]
|
||||
keywords = _ gettext ngettext l_ lazy_gettext _LI _LW _LE _LC
|
||||
mapping_file = babel.cfg
|
||||
output_file = watcherclient/locale/watcherclient.pot
|
||||
|
||||
9
setup.py
9
setup.py
@@ -13,17 +13,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
|
||||
import setuptools
|
||||
|
||||
# In python < 2.7.4, a lazy loading of package `pbr` will break
|
||||
# setuptools if some other modules registered functions in `atexit`.
|
||||
# solution from: http://bugs.python.org/issue15881#msg170215
|
||||
try:
|
||||
import multiprocessing # noqa
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['pbr>=2.0.0'],
|
||||
pbr=True)
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
|
||||
coverage!=4.4,>=4.0 # Apache-2.0
|
||||
fixtures>=3.0.0 # Apache-2.0/BSD
|
||||
hacking>=1.1.0,<1.2.0 # Apache-2.0
|
||||
mock>=2.0.0 # BSD
|
||||
hacking>=3.0.1,<3.1.0 # Apache-2.0
|
||||
oslotest>=3.2.0 # Apache-2.0
|
||||
python-subunit>=1.0.0 # Apache-2.0/BSD
|
||||
stestr>=2.0.0 # Apache-2.0
|
||||
|
||||
23
tox.ini
23
tox.ini
@@ -1,6 +1,6 @@
|
||||
[tox]
|
||||
minversion = 2.0
|
||||
envlist = py36,py37,py27,pep8
|
||||
envlist = py36,py38,pep8
|
||||
skipsdist = True
|
||||
|
||||
[testenv]
|
||||
@@ -11,7 +11,7 @@ install_command = pip install {opts} {packages}
|
||||
setenv =
|
||||
VIRTUAL_ENV={envdir}
|
||||
deps =
|
||||
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/train}
|
||||
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/victoria}
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
-r{toxinidir}/requirements.txt
|
||||
whitelist_externals =
|
||||
@@ -43,10 +43,23 @@ commands =
|
||||
[testenv:docs]
|
||||
basepython = python3
|
||||
deps =
|
||||
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/train}
|
||||
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/victoria}
|
||||
-r{toxinidir}/requirements.txt
|
||||
-r{toxinidir}/doc/requirements.txt
|
||||
commands = python setup.py build_sphinx
|
||||
commands = sphinx-build -W -b html doc/source doc/build/html
|
||||
|
||||
|
||||
[testenv:pdf-docs]
|
||||
basepython = python3
|
||||
envdir = {toxworkdir}/docs
|
||||
deps = {[testenv:docs]deps}
|
||||
whitelist_externals =
|
||||
rm
|
||||
make
|
||||
commands =
|
||||
rm -rf doc/build/pdf
|
||||
sphinx-build -W -b latex doc/source doc/build/pdf
|
||||
make -C doc/build/pdf
|
||||
|
||||
[testenv:debug]
|
||||
basepython = python3
|
||||
@@ -56,7 +69,7 @@ commands = oslo_debug_helper -t watcherclient/tests/unit {posargs}
|
||||
# E123, E125 skipped as they are invalid PEP-8.
|
||||
show-source = True
|
||||
enable-extensions = H203,H106
|
||||
ignore = E123,E125
|
||||
ignore = E123,E125,W504
|
||||
builtins = _
|
||||
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@ from watcherclient import exceptions
|
||||
|
||||
# Record the latest version that this client was tested with.
|
||||
DEFAULT_VER = '1.latest'
|
||||
# Minor version 2 for adding force option to audit
|
||||
LAST_KNOWN_API_VERSION = 2
|
||||
# Minor version 4 for adding webhook API
|
||||
LAST_KNOWN_API_VERSION = 4
|
||||
LATEST_VERSION = '1.{}'.format(LAST_KNOWN_API_VERSION)
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import uuid
|
||||
|
||||
@@ -71,6 +71,7 @@ class AmbiguousAuthSystem(exceptions.ClientException):
|
||||
"""Could not obtain token and endpoint using provided credentials."""
|
||||
pass
|
||||
|
||||
|
||||
# Alias for backwards compatibility
|
||||
AmbigiousAuthSystem = AmbiguousAuthSystem
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from watcherclient.common import api_versioning
|
||||
from watcherclient import exceptions
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from keystoneauth1 import loading as kaloading
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from watcherclient.common.apiclient import exceptions as exc
|
||||
from watcherclient.common import utils
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
|
||||
import copy
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
import fixtures
|
||||
import mock
|
||||
from oslo_utils import strutils
|
||||
import six
|
||||
import testtools
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
# limitations under the License.
|
||||
|
||||
import shlex
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from osc_lib import utils as oscutils
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
import copy
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import testtools
|
||||
from testtools import matchers
|
||||
|
||||
@@ -14,10 +14,11 @@
|
||||
# limitations under the License.
|
||||
|
||||
import datetime
|
||||
import mock
|
||||
import six
|
||||
from unittest import mock
|
||||
|
||||
from oslo_utils.uuidutils import generate_uuid
|
||||
import six
|
||||
|
||||
from watcherclient import exceptions
|
||||
from watcherclient import shell
|
||||
from watcherclient.tests.unit.v1 import base
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
# under the License.
|
||||
|
||||
import datetime
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import six
|
||||
|
||||
from watcherclient import exceptions
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
# under the License.
|
||||
|
||||
import datetime
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import six
|
||||
|
||||
from watcherclient import shell
|
||||
@@ -426,6 +427,23 @@ class AuditShellTest(base.CommandTestCase):
|
||||
parameters={'para1': 10, 'para2': 20}
|
||||
)
|
||||
|
||||
def test_do_audit_create_with_type_event(self):
|
||||
audit = resource.Audit(mock.Mock(), self.AUDIT_1)
|
||||
self.m_audit_mgr.create.return_value = audit
|
||||
|
||||
exit_code, result = self.run_cmd(
|
||||
'audit create -g fc087747-61be-4aad-8126-b701731ae836 -t EVENT')
|
||||
|
||||
self.assertEqual(0, exit_code)
|
||||
self.assertEqual(
|
||||
self.resource_as_dict(audit, self.FIELDS, self.FIELD_LABELS),
|
||||
result)
|
||||
self.m_audit_mgr.create.assert_called_once_with(
|
||||
goal='fc087747-61be-4aad-8126-b701731ae836',
|
||||
auto_trigger=False,
|
||||
audit_type='EVENT'
|
||||
)
|
||||
|
||||
def test_do_audit_create_with_type_continuous(self):
|
||||
audit = resource.Audit(mock.Mock(), self.AUDIT_1)
|
||||
self.m_audit_mgr.create.return_value = audit
|
||||
@@ -642,6 +660,24 @@ class AuditShellTestv12(AuditShellTest):
|
||||
force=False
|
||||
)
|
||||
|
||||
def test_do_audit_create_with_type_event(self):
|
||||
audit = resource.Audit(mock.Mock(), self.AUDIT_1)
|
||||
self.m_audit_mgr.create.return_value = audit
|
||||
|
||||
exit_code, result = self.run_cmd(
|
||||
'audit create -g fc087747-61be-4aad-8126-b701731ae836 -t EVENT')
|
||||
|
||||
self.assertEqual(0, exit_code)
|
||||
self.assertEqual(
|
||||
self.resource_as_dict(audit, self.FIELDS, self.FIELD_LABELS),
|
||||
result)
|
||||
self.m_audit_mgr.create.assert_called_once_with(
|
||||
goal='fc087747-61be-4aad-8126-b701731ae836',
|
||||
auto_trigger=False,
|
||||
audit_type='EVENT',
|
||||
force=False
|
||||
)
|
||||
|
||||
def test_do_audit_create_with_name(self):
|
||||
audit = resource.Audit(mock.Mock(), self.AUDIT_1)
|
||||
self.m_audit_mgr.create.return_value = audit
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
# under the License.
|
||||
|
||||
import datetime
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import six
|
||||
|
||||
from watcherclient import shell
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
import mock
|
||||
|
||||
from unittest import mock
|
||||
|
||||
import six
|
||||
|
||||
from watcherclient import shell
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
# limitations under the License.
|
||||
|
||||
import datetime
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import six
|
||||
|
||||
from watcherclient import shell
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
# limitations under the License.
|
||||
|
||||
import datetime
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import six
|
||||
|
||||
from watcherclient import shell
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
# limitations under the License.
|
||||
|
||||
import datetime
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import six
|
||||
|
||||
from watcherclient import shell
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
# limitations under the License.
|
||||
|
||||
import datetime
|
||||
import mock
|
||||
import six
|
||||
from unittest import mock
|
||||
|
||||
from oslo_serialization import jsonutils
|
||||
import six
|
||||
|
||||
from watcherclient import shell
|
||||
from watcherclient.tests.unit.v1 import base
|
||||
|
||||
@@ -167,8 +167,8 @@ class CreateAudit(command.ShowOne):
|
||||
dest='audit_type',
|
||||
metavar='<audit_type>',
|
||||
default='ONESHOT',
|
||||
choices=['ONESHOT', 'CONTINUOUS'],
|
||||
help=_("Audit type. It must be ONESHOT or CONTINUOUS. "
|
||||
choices=['ONESHOT', 'CONTINUOUS', 'EVENT'],
|
||||
help=_("Audit type. It must be ONESHOT, CONTINUOUS or EVENT. "
|
||||
"Default is ONESHOT."))
|
||||
parser.add_argument(
|
||||
'-p', '--parameter',
|
||||
@@ -182,7 +182,7 @@ class CreateAudit(command.ShowOne):
|
||||
dest='interval',
|
||||
metavar='<interval>',
|
||||
help=_('Audit interval (in seconds or cron format). '
|
||||
'Cron inteval can be used like: "*/5 * * * *". '
|
||||
'Cron interval can be used like: ``*/5 * * * *``. '
|
||||
'Only used if the audit is CONTINUOUS.'))
|
||||
parser.add_argument(
|
||||
'-g', '--goal',
|
||||
|
||||
@@ -167,8 +167,8 @@ class CreateAuditTemplate(command.ShowOne):
|
||||
metavar='<path>',
|
||||
help=_("Part of the cluster on which an audit will be done.\n"
|
||||
"Can be provided either in yaml or json file.\n"
|
||||
"YAML example:\n"
|
||||
"---\n"
|
||||
"YAML example::\n"
|
||||
"\n"
|
||||
" - compute:\n"
|
||||
" - host_aggregates:\n"
|
||||
" - id: 1\n"
|
||||
@@ -201,48 +201,49 @@ class CreateAuditTemplate(command.ShowOne):
|
||||
" - uuid: UUID1\n"
|
||||
" - uuid: UUID2\n"
|
||||
"\n"
|
||||
"JSON example:\n"
|
||||
"[\n"
|
||||
" {\"compute\":\n"
|
||||
" [{\"host_aggregates\": [\n"
|
||||
" {\"id\": 1},\n"
|
||||
" {\"id\": 2},\n"
|
||||
" {\"id\": 3}]},\n"
|
||||
" {\"availability_zones\": [\n"
|
||||
" {\"name\": \"AZ1\"},\n"
|
||||
" {\"name\": \"AZ2\"}]},\n"
|
||||
" {\"exclude\": [\n"
|
||||
" {\"instances\": [\n"
|
||||
" {\"uuid\": \"UUID1\"},\n"
|
||||
" {\"uuid\": \"UUID2\"}\n"
|
||||
" ]},\n"
|
||||
" {\"compute_nodes\": [\n"
|
||||
" {\"name\": \"compute1\"}\n"
|
||||
" ]}\n"
|
||||
" ]}]\n"
|
||||
" },\n"
|
||||
" {\"storage\":\n"
|
||||
" [{\"availability_zones\": [\n"
|
||||
" {\"name\": \"AZ1\"},\n"
|
||||
" {\"name\": \"AZ2\"}]},\n"
|
||||
" {\"volume_types\": [\n"
|
||||
" {\"name\": \"lvm1\"},\n"
|
||||
" {\"name\": \"lvm2\"}]},\n"
|
||||
" {\"exclude\": [\n"
|
||||
" {\"storage_pools\": [\n"
|
||||
" {\"name\": \"host0@backend0#pool0\"},\n"
|
||||
" {\"name\": \"host1@backend1#pool1\"}\n"
|
||||
" ]},\n"
|
||||
" {\"volumes\": [\n"
|
||||
" {\"uuid\": \"UUID1\"},\n"
|
||||
" {\"uuid\": \"UUID2\"}\n"
|
||||
" ]},\n"
|
||||
" {\"projects\": [\n"
|
||||
" {\"uuid\": \"UUID1\"},\n"
|
||||
" {\"uuid\": \"UUID2\"}\n"
|
||||
" ]},\n"
|
||||
" ]}]\n"
|
||||
" }\n"
|
||||
"JSON example::\n"
|
||||
"\n"
|
||||
" [\n"
|
||||
" {\"compute\":\n"
|
||||
" [{\"host_aggregates\": [\n"
|
||||
" {\"id\": 1},\n"
|
||||
" {\"id\": 2},\n"
|
||||
" {\"id\": 3}]},\n"
|
||||
" {\"availability_zones\": [\n"
|
||||
" {\"name\": \"AZ1\"},\n"
|
||||
" {\"name\": \"AZ2\"}]},\n"
|
||||
" {\"exclude\": [\n"
|
||||
" {\"instances\": [\n"
|
||||
" {\"uuid\": \"UUID1\"},\n"
|
||||
" {\"uuid\": \"UUID2\"}\n"
|
||||
" ]},\n"
|
||||
" {\"compute_nodes\": [\n"
|
||||
" {\"name\": \"compute1\"}\n"
|
||||
" ]}\n"
|
||||
" ]}]\n"
|
||||
" },\n"
|
||||
" {\"storage\":\n"
|
||||
" [{\"availability_zones\": [\n"
|
||||
" {\"name\": \"AZ1\"},\n"
|
||||
" {\"name\": \"AZ2\"}]},\n"
|
||||
" {\"volume_types\": [\n"
|
||||
" {\"name\": \"lvm1\"},\n"
|
||||
" {\"name\": \"lvm2\"}]},\n"
|
||||
" {\"exclude\": [\n"
|
||||
" {\"storage_pools\": [\n"
|
||||
" {\"name\": \"host0@backend0#pool0\"},\n"
|
||||
" {\"name\": \"host1@backend1#pool1\"}\n"
|
||||
" ]},\n"
|
||||
" {\"volumes\": [\n"
|
||||
" {\"uuid\": \"UUID1\"},\n"
|
||||
" {\"uuid\": \"UUID2\"}\n"
|
||||
" ]},\n"
|
||||
" {\"projects\": [\n"
|
||||
" {\"uuid\": \"UUID1\"},\n"
|
||||
" {\"uuid\": \"UUID2\"}\n"
|
||||
" ]},\n"
|
||||
" ]}]\n"
|
||||
" }\n"
|
||||
" ]\n"
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user