Skip to content

Compute: "policy", "rules" add servergroups Create #1636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ozerovandrei
Copy link
Contributor

Add "policy" and "rules" fields for servergroups Create call.
Those fields are available in 2.64 microversion.

Remove required attribute from the "policies" field.

Add "omitempty" attribute to the Rules.MaxServerPerHost field.

For #1600

Links to the line numbers/files in the OpenStack source code that support the
code in this PR:

https://github.com/openstack/nova/blob/stable/stein/nova/api/openstack/compute/server_groups.py#L186

Add "policy" and "rules" extract methods to servergroups package.
Those methods are available in 2.64 microversion.
Add "policy" and "rules" fields for servergroups Create call.
Those fields are available in 2.64 microversion.

Remove required attribute from the "policies" field.

Add "omitempty" attribute to the Rules.MaxServerPerHost field.
@coveralls
Copy link

coveralls commented Jul 1, 2019

Coverage Status

Coverage increased (+0.02%) to 76.876% when pulling e02deb6 on ozerovandrei:os-server-groups-2.64-create into a26f5d9 on gophercloud:master.

@ozerovandrei
Copy link
Contributor Author

recheck

@theopenlab-ci
Copy link

theopenlab-ci bot commented Jul 1, 2019

Build failed.

@ozerovandrei
Copy link
Contributor Author

ozerovandrei commented Jul 2, 2019

convenience.go:35: �[1;31mFailure in servergroup_test.go, line 20: unexpected error �[0m�[1;33m"Bad request with: [POST http://192.168.0.35/compute/v2.1/os-server-groups], error message: {\"badRequest\": {\"message\": \"Invalid input for field/attribute server_group. Value: {u'rules': {}, u'name': u'ACPTTESTsH3LuHOJEBKFaOfo', u'policies': [u'anti-affinity']}. Additional properties are not allowed (u'rules' was unexpected)\", \"code\": 400}}"�[0m�[1;31m�[0m

I will refactor servergroups tests to check that package with and without microversion additions.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Jul 8, 2019

Build failed.

Use pointer to Rules in servergroups create options to prevent its
addition to create options without microversion.

Update servergroups package tests to test for cases with and without
microversion 2.64.
@ozerovandrei ozerovandrei force-pushed the os-server-groups-2.64-create branch from 8cdbf3a to e02deb6 Compare July 8, 2019 07:48
@theopenlab-ci
Copy link

theopenlab-ci bot commented Jul 8, 2019

Build succeeded.

@ozerovandrei ozerovandrei merged commit 3b05c00 into gophercloud:master Jul 9, 2019
@ozerovandrei ozerovandrei deleted the os-server-groups-2.64-create branch July 9, 2019 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants