Compare commits

...

6 Commits
4.7.0 ... 1.3.1

Author SHA1 Message Date
Nguyen Hai
4a8cf8445e import zuul job settings from project-config
This is a mechanically generated patch to complete step 1 of moving
the zuul job settings out of project-config and into each project
repository.

Because there will be a separate patch on each branch, the branch
specifiers for branch-specific jobs have been removed.

Because this patch is generated by a script, there may be some
cosmetic changes to the layout of the YAML file(s) as the contents are
normalized.

See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html

Change-Id: I6e15638497fc016dca98189dc15397d61d268433
Story: #2002586
Task: #24344
2018-08-19 00:58:47 +09:00
OpenStack Proposal Bot
e28f0e7ee2 Updated from global requirements
Change-Id: I7236e4ba660824d4ae8b72f0c2f79a49ae36861b
2017-09-15 07:45:58 +00:00
zte-hanrong
b45c813d9a Add the filed of description to shell command for action.
blueprint dynamic-action-description

Change-Id: I927cf966530059d9c7af1e6e60a8d75dd3e6b812
(cherry picked from commit 08fbccc684)
2017-08-24 08:45:20 +00:00
Alexander Chadin
4a47b7886d Fix Audit Update functional test
Change-Id: Iffd70302d0b1d7a919db3e6e44bd3bbebcb1e7ce
(cherry picked from commit d6b68dc819)
2017-08-24 07:49:35 +00:00
f5eae02253 Update UPPER_CONSTRAINTS_FILE for stable/pike
Change-Id: I933e0a2cc99083aefae75648578800af7047c343
2017-07-28 21:08:25 +00:00
b6fe5c9261 Update .gitreview for stable/pike
Change-Id: I0ef7e43614425d4f88a2f3b5c2d90dfe3bb7f6c2
2017-07-28 21:08:24 +00:00
9 changed files with 32 additions and 13 deletions

View File

@@ -2,3 +2,4 @@
host=review.openstack.org
port=29418
project=openstack/python-watcherclient.git
defaultbranch=stable/pike

12
.zuul.yaml Normal file
View File

@@ -0,0 +1,12 @@
- project:
templates:
- openstack-python-jobs
- openstack-python35-jobs
- publish-openstack-sphinx-docs
- check-requirements
- openstackclient-plugin-jobs
check:
jobs:
- openstack-tox-cover:
voting: false

View File

@@ -9,6 +9,6 @@ oslo.i18n!=3.15.2,>=2.1.0 # Apache-2.0
oslo.utils>=3.20.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.1.0 # Apache-2.0
six>=1.9.0 # MIT
PyYAML>=3.10.0 # MIT

View File

@@ -6,7 +6,7 @@ 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
openstackdocstheme>=1.16.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

View File

@@ -6,7 +6,7 @@ skipsdist = True
[testenv]
usedevelop = True
install_command =
constraints: pip install -U --force-reinstall -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
constraints: pip install -U --force-reinstall -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike} {opts} {packages}
pip install -U {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}

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":

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']