yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #30440
[Bug 1434172] Re: security group create errors without description
@sdague, I made a change to novaclient to ensure the body does not
include the description value.
You can see in the log below that the body is just: {"security_group":
{"name": "tempo"}}
But, the result remains the same (400 with description is not a string or unicode):
2015-03-25 00:22:48.445 DEBUG nova.api.openstack.wsgi [req-0c501906-c662-4afd-a3fc-3b6e5e22caf9 admin admin] Action: 'create', calling method: <bound method SecurityGroupController.create of <nova.api.openstack.compute.contrib.security_groups.SecurityGroupController object at 0x7f0768586cd0>>, body: {"security_group": {"name": "tempo"}} from (pid=14913) _process_stack /opt/stack/nova/nova/api/openstack/wsgi.py:780
2015-03-25 00:22:48.447 INFO nova.api.openstack.wsgi [req-0c501906-c662-4afd-a3fc-3b6e5e22caf9 admin admin] HTTP exception thrown: Security group description is not a string or unicode
2015-03-25 00:22:48.447 DEBUG nova.api.openstack.wsgi [req-0c501906-c662-4afd-a3fc-3b6e5e22caf9 admin admin] Returning 400 to user: Security group description is not a string or unicode from (pid=14913) __call__ /opt/stack/nova/nova/api/openstack/wsgi.py:1166
2015-03-25 00:22:48.450 INFO nova.osapi_compute.wsgi.server [req-0c501906-c662-4afd-a3fc-3b6e5e22caf9 admin admin] 10.0.2.15 "POST /v2/36c7f6452c394b44ad4ae1f2bfe07800/os-security-groups HTTP/1.1" status: 400 len: 317 time: 0.1127591
This is the change that I made to novaclient
steve:python-novaclient$ git diff
diff --git a/novaclient/v2/security_groups.py b/novaclient/v2/security_groups.py
index 40d1e7f..0cd4960 100644
--- a/novaclient/v2/security_groups.py
+++ b/novaclient/v2/security_groups.py
@@ -45,7 +45,9 @@ class SecurityGroupManager(base.ManagerWithFind):
:param description: description of the security group
:rtype: the security group object
"""
- body = {"security_group": {"name": name, 'description': description}}
+ body = {"security_group": {"name": name}}
+ if description:
+ body['security_group']['description'] = description
return self._create('/os-security-groups', body, 'security_group')
Double checked that it still works for the case with a description, and
it does.
2015-03-25 00:25:28.870 DEBUG nova.api.openstack.wsgi [req-e2be9899-c50a-40fc-9eaa-258db57b5cf3 admin admin] Action: 'create', calling method: <bound method SecurityGroupController.create of <nova.api.openstack.compute.contrib.security_groups.SecurityGroupController object at 0x7f0768586cd0>>, body: {"security_group": {"name": "tempo", "description": "tempo_desc"}} from (pid=14913) _process_stack /opt/stack/nova/nova/api/openstack/wsgi.py:780
2015-03-25 00:25:28.871 DEBUG oslo_db.api [req-e2be9899-c50a-40fc-9eaa-258db57b5cf3 admin admin] Loading backend 'sqlalchemy' from 'nova.db.sqlalchemy.api' from (pid=14913) _load_backend /usr/local/lib/python2.7/dist-packages/oslo_db/api.py:214
2015-03-25 00:25:28.872 WARNING oslo_config.cfg [req-e2be9899-c50a-40fc-9eaa-258db57b5cf3 admin admin] Option "sql_connection" from group "DEFAULT" is deprecated. Use option "connection" from group "database".
2015-03-25 00:25:28.892 DEBUG oslo_db.sqlalchemy.session [req-e2be9899-c50a-40fc-9eaa-258db57b5cf3 admin admin] MySQL server mode set to STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION from (pid=14913) _check_effective_sql_mode /usr/local/lib/python2.7/dist-packages/oslo_db/sqlalchemy/session.py:513
2015-03-25 00:25:29.089 DEBUG nova.quota [req-e2be9899-c50a-40fc-9eaa-258db57b5cf3 admin admin] Created reservations ['abcd8046-85b8-4a9f-a7ac-258e0050d10c'] from (pid=14913) reserve /opt/stack/nova/nova/quota.py:1319
2015-03-25 00:25:29.090 INFO nova.compute.api [req-e2be9899-c50a-40fc-9eaa-258db57b5cf3 admin admin] Create Security Group tempo
To me it still looks like this call will always fail:
self.security_group_api.validate_property(group_description,
'description', None)
Since it always attempts to strip the value and match it with something
** Changed in: nova
Status: Invalid => New
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1434172
Title:
security group create errors without description
Status in OpenStack Compute (Nova):
New
Status in Python client library for Nova:
In Progress
Status in OpenStack Command Line Client:
In Progress
Bug description:
security group create returns an error without --description supplied.
This appears to be the server rejecting the request so we should set a
default value rather than sending None.
$ openstack security group create qaz
ERROR: openstack Security group description is not a string or unicode (HTTP 400) (Request-ID: req-dee03de3-893a-4d58-bc3d-de87d09c3fb8)
Sent body:
{"security_group": {"name": "qaz2", "description": null}}
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1434172/+subscriptions