Compare commits

...

17 Commits
1.3.1 ... 1.4.0

Author SHA1 Message Date
OpenStack Proposal Bot
0fd1b11f6d Updated from global requirements
Change-Id: I2cee86f0b7a9b7630322d1364463a97dbbe60b35
2017-10-10 12:36:58 +00:00
Alexander Chadin
e92dd4db20 Fix gate-watcherclient-dsvm-functional-ubuntu-xenial job
Closes-Bug: #1722212
Change-Id: I8d5cb2fd1a17beb6049fb5d2a560fc31ba77fe3d
2017-10-09 15:45:03 +03:00
OpenStack Proposal Bot
ad0a32886d Updated from global requirements
Change-Id: I83a8ff2c92353500dd10da5a4c5e17c3c6be1b8e
2017-09-16 23:24:29 +00:00
OpenStack Proposal Bot
84f05d8e40 Updated from global requirements
Change-Id: Iabc543ea5aef45e3751629ba9be55a7e8fcd97c6
2017-09-13 13:03:41 +00:00
Jenkins
b33a444e90 Merge "Fix to use "." to source script files" 2017-09-06 07:59:28 +00:00
OpenStack Proposal Bot
27d1e4c85a Updated from global requirements
Change-Id: I9bfc8466e06767001cd0a2ff5eedde2572c165a4
2017-09-02 11:51:57 +00:00
Jenkins
77eb8f677f Merge "import content from cli-reference in openstack-manuals" 2017-09-02 09:24:51 +00:00
melissaml
320bb4c14f Fix to use "." to source script files
Adhering to coding conventions. Refer to ``Code conventions`` at
https://docs.openstack.org/contributor-guide/ for details.

Change-Id: Ie6b7d00e63acba0ffd8b27acd791fdb0b08417fe
2017-08-29 02:42:07 +08:00
Hidekazu Nakamura
7b5908b390 import content from cli-reference in openstack-manuals
This patch addes details.rst generated automatically by
openstack-doc-tools.

Change-Id: Ia9cd77f7fe5841d9b5bc2c81e3c1974ec3a744dd
2017-08-28 12:13:36 +09:00
OpenStack Proposal Bot
1d69f6a72f Updated from global requirements
Change-Id: I12c059b5ee28a43d5f8cdd6f5f0a4fff5fd9a6bd
2017-08-18 04:52:50 +00:00
OpenStack Proposal Bot
0e080e7294 Updated from global requirements
Change-Id: I04b7b0dc0816b976ec4097503b7f6797a9c838cd
2017-08-01 03:05:22 +00:00
Jenkins
c09ad28c9a Merge "Fix Audit Update functional test" 2017-08-01 02:16:37 +00:00
zte-hanrong
08fbccc684 Add the filed of description to shell command for action.
blueprint dynamic-action-description

Change-Id: I927cf966530059d9c7af1e6e60a8d75dd3e6b812
2017-07-27 16:07:11 +08:00
Jenkins
2f2d05d657 Merge "Update .gitignore because of doc migration" 2017-07-26 12:26:18 +00:00
Alexander Chadin
d6b68dc819 Fix Audit Update functional test
Change-Id: Iffd70302d0b1d7a919db3e6e44bd3bbebcb1e7ce
2017-07-26 11:09:18 +03:00
Jenkins
a70d587803 Merge "Update the documentation link for doc migration" 2017-07-25 13:36:51 +00:00
Hangdong Zhang
2e47d77f86 Update the documentation link for doc migration
Change-Id: Ia7119776f3d173af71561b1263e021dafc5c010d
BTW: Do some optimization as well (http -> https)
2017-07-24 13:55:17 +08:00
16 changed files with 1067 additions and 31 deletions

View File

@@ -1,13 +1,13 @@
If you would like to contribute to the development of OpenStack,
you must follow the steps in this page:
http://docs.openstack.org/infra/manual/developers.html
https://docs.openstack.org/infra/manual/developers.html
Once those steps have been completed, changes to OpenStack
should be submitted for review via the Gerrit tool, following
the workflow documented at:
http://docs.openstack.org/infra/manual/developers.html#development-workflow
https://docs.openstack.org/infra/manual/developers.html#development-workflow
Pull requests submitted through GitHub will be ignored.

View File

@@ -1,4 +1,4 @@
python-watcherclient Style Commandments
=======================================
Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/
Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/

View File

@@ -23,9 +23,9 @@ operating costs, increased system performance via intelligent virtual machine
migration, increased energy efficiency-and more!
* Free software: Apache license
* Wiki: http://wiki.openstack.org/wiki/Watcher
* Source: http://git.openstack.org/cgit/openstack/python-watcher
* Bugs: http://bugs.launchpad.net/watcher
* Wiki: https://wiki.openstack.org/wiki/Watcher
* Source: https://git.openstack.org/cgit/openstack/python-watcher
* Bugs: https://bugs.launchpad.net/watcher
Installation
============
@@ -61,7 +61,7 @@ You can install the Watcher CLI with the following command:
sudo pip install python-watcherclient
You can also use the `OpenStack client <http://docs.openstack.org/cli-reference/overview.html>`_
You can also use the `OpenStack client <https://docs.openstack.org/python-openstackclient/latest/>`_
with Watcher (our watcher plugin for OpenStack client is included in the
python-watcherclient package). To install it, you have just to run this command:

1012
doc/source/cli/details.rst Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -29,3 +29,4 @@ Once you've configured your authentication parameters, you can run
watcher
openstack_cli
details

View File

@@ -55,7 +55,7 @@ fill partially typed commands. To use this feature, source the below file
https://git.openstack.org/cgit/openstack/python-watcherclient/tree/tools/watcher.bash_completion)
to your terminal and then bash completion should work::
$ source watcher.bash_completion
$ . watcher.bash_completion
To avoid doing this every time, add this to your ``.bashrc`` or copy the
watcher.bash_completion file to the default bash completion scripts directory

View File

@@ -19,8 +19,8 @@ signed OpenStack's contributor's agreement.
.. seealso::
* http://docs.openstack.org/infra/manual/developers.html
* http://wiki.openstack.org/CLA
* https://docs.openstack.org/infra/manual/developers.html
* https://wiki.openstack.org/CLA
LaunchPad Project
-----------------
@@ -41,7 +41,7 @@ Project Hosting Details
-------------------------
Bug tracker
http://launchpad.net/python-watcherclient
https://launchpad.net/python-watcherclient
Mailing list (prefix subjects with ``[watcher]`` for faster responses)
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

View File

@@ -3,12 +3,12 @@
# process, which may cause wedges in the gate later.
Babel!=2.4.0,>=2.3.4 # BSD
cliff>=2.8.0 # Apache-2.0
cliff!=2.9.0,>=2.8.0 # Apache-2.0
osc-lib>=1.7.0 # Apache-2.0
oslo.i18n!=3.15.2,>=2.1.0 # Apache-2.0
oslo.utils>=3.20.0 # Apache-2.0
oslo.i18n>=3.15.3 # Apache-2.0
oslo.utils>=3.28.0 # Apache-2.0
pbr!=2.1.0,>=2.0.0 # Apache-2.0
PrettyTable<0.8,>=0.7.1 # BSD
keystoneauth1>=3.0.1 # Apache-2.0
keystoneauth1>=3.2.0 # Apache-2.0
six>=1.9.0 # MIT
PyYAML>=3.10.0 # MIT
PyYAML>=3.10 # MIT

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/python-watcherclient
home-page = https://docs.openstack.org/python-watcherclient/latest/
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology

View File

@@ -5,8 +5,8 @@
coverage!=4.4,>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
mock>=2.0 # BSD
openstackdocstheme>=1.11.0 # Apache-2.0
mock>=2.0.0 # BSD
openstackdocstheme>=1.17.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0
python-subunit>=0.0.18 # Apache-2.0/BSD
sphinx>=1.6.2 # BSD
@@ -16,4 +16,4 @@ testtools>=1.4.0 # MIT
tempest>=16.1.0 # Apache-2.0
# Needed for pypi packaging
wheel # MIT
wheel>=0.24.0 # MIT

View File

@@ -75,7 +75,7 @@ def import_versioned_module(version, submodule=None):
return importutils.import_module(module)
def split_and_deserialize(string):
def split_and_deserialize(string, exclude_fields=[]):
"""Split and try to JSON deserialize a string.
Gets a string with the KEY=VALUE format, split it (using '=' as the
@@ -88,10 +88,11 @@ def split_and_deserialize(string):
except ValueError:
raise exc.CommandError(_('Attributes must be a list of '
'PATH=VALUE not "%s"') % string)
try:
value = jsonutils.loads(value)
except ValueError:
pass
if key not in exclude_fields:
try:
value = jsonutils.loads(value)
except ValueError:
pass
return (key, value)
@@ -104,7 +105,7 @@ def args_array_to_dict(kwargs, key_to_convert):
return kwargs
def args_array_to_patch(op, attributes):
def args_array_to_patch(op, attributes, exclude_fields=[]):
patch = []
for attr in attributes:
# Sanitize
@@ -112,7 +113,8 @@ def args_array_to_patch(op, attributes):
attr = '/' + attr
if op in ['add', 'replace']:
path, value = split_and_deserialize(attr)
path, value = split_and_deserialize(attr,
exclude_fields=exclude_fields)
patch.append({'op': op, 'path': path, 'value': value})
elif op == "remove":

View File

@@ -26,7 +26,7 @@ You need to install virtualenv, create a virtual environment and activate it::
$ pip install virtualenv
$ virtualenv watcher-env
$ source watcher-env/bin/activate
$ . watcher-env/bin/activate
Then, to install Tempest you can issue the following commands::

View File

@@ -10,6 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import os
import re
import shlex
import subprocess
@@ -20,9 +22,24 @@ from tempest.lib.cli import output_parser
from tempest.lib import exceptions
def credentials():
creds = {
'--os-username': os.environ.get('OS_USERNAME', 'admin'),
'--os-password': os.environ.get('OS_PASSWORD', 'secretadmin'),
'--os-project-name': os.environ.get('OS_PROJECT_NAME', 'admin'),
'--os-auth-url': os.environ.get('OS_AUTH_URL',
'http://10.0.1.94/identity'),
'--os-project-domain-id': os.environ.get('OS_PROJECT_DOMAIN_ID',
'default'),
'--os-user-domain-id': os.environ.get('OS_USER_DOMAIN_ID', 'default'),
}
return [x for sub in creds.items() for x in sub]
def execute(cmd, fail_ok=False, merge_stderr=False):
"""Executes specified command for the given action."""
cmdlist = shlex.split(cmd)
cmdlist.extend(credentials())
stdout = subprocess.PIPE
stderr = subprocess.STDOUT if merge_stderr else subprocess.PIPE
proc = subprocess.Popen(cmdlist, stdout=stdout, stderr=stderr)

3
watcherclient/tests/unit/v1/test_action_shell.py Normal file → Executable file
View File

@@ -30,6 +30,7 @@ ACTION_1 = {
'action_type': 'migrate',
'parents': ['239f02a5-9649-4e14-9d33-ac2bf67cb755'],
'input_parameters': {"test": 1},
'description': 'test',
'created_at': datetime.datetime.now().isoformat(),
'updated_at': None,
'deleted_at': None,
@@ -42,6 +43,7 @@ ACTION_2 = {
'action_type': 'migrate',
'parents': ['67653274-eb24-c7ba-70f6-a84e73d80843'],
'input_parameters': {"test": 2},
'description': 'test',
'created_at': datetime.datetime.now().isoformat(),
'updated_at': None,
'deleted_at': None,
@@ -53,6 +55,7 @@ ACTION_3 = {
'parents': [],
'state': 'PENDING',
'action_type': 'sleep',
'description': 'test',
'created_at': datetime.datetime.now().isoformat(),
'updated_at': None,
'deleted_at': None,

View File

@@ -243,7 +243,8 @@ class UpdateAudit(command.ShowOne):
raise exceptions.ValidationError()
patch = common_utils.args_array_to_patch(
parsed_args.op, parsed_args.attributes[0])
parsed_args.op, parsed_args.attributes[0],
exclude_fields=['/interval'])
audit = client.audit.update(parsed_args.audit, patch)

4
watcherclient/v1/resource_fields.py Normal file → Executable file
View File

@@ -64,11 +64,11 @@ ACTION_PLAN_SHORT_LIST_FIELD_LABELS = ['UUID', 'Audit', 'State',
# Action
ACTION_FIELDS = ['uuid', 'created_at', 'updated_at', 'deleted_at', 'parents',
'state', 'action_plan_uuid', 'action_type',
'input_parameters']
'input_parameters', 'description']
ACTION_FIELD_LABELS = ['UUID', 'Created At', 'Updated At', 'Deleted At',
'Parents', 'State', 'Action Plan', 'Action',
'Parameters']
'Parameters', 'Description']
ACTION_SHORT_LIST_FIELDS = ['uuid', 'parents',
'state', 'action_plan_uuid', 'action_type']