yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #54690
[Bug 1609865] [NEW] Remove security group can not pase security group parameters
Public bug reported:
openstack --debug server remove security group test-server throws an
exception after getting the security group parameters, while add
security gruop can handle the same situation.
Here is the execution log of add security group:
$ openstack --debug server add security group test-server 11111111-5bf3-422a-89d6-34af3e38bdbb
START with options: ['--debug', 'server', 'add', 'security', 'group', 'test-server', '11111111-5bf3-422a-89d6-34af3e38bdbb']
options: Namespace(access_token_endpoint='', auth_type='', auth_url='http://1.1.1.1:5000/v2.0', cacert='', client_id='', client_secret='***', cloud='', debug=True, default_domain='default', deferred_help=False, domain_id='', domain_name='', endpoint='', identity_provider='', identity_provider_url='', insecure=None, inspector_api_version='1', inspector_url=None, interface='', log_file=None, os_application_catalog_api_version='1', os_baremetal_api_version='1.6', os_clustering_api_version='1', os_compute_api_version='', os_data_processing_api_version='1.1', os_data_processing_url='', os_dns_api_version='2', os_identity_api_version='2.0', os_image_api_version='', os_key_manager_api_version='1', os_network_api_version='', os_object_api_version='', os_orchestration_api_version='1', os_project_id=None, os_project_name=None, os_queues_api_version='1.1', os_translator_api_version='1', os_volume_api_version='2', os_workflow_api_version='2', password='***', profile=None, project_domain_id='', project_domain_name='', project_id='', project_name='demo', protocol='', region_name='RegionOne', scope='', service_provider_endpoint='', timing=False, token='***', trust_id='', url='', user_domain_id='', user_domain_name='', user_id='', username='admin', verbose_level=3, verify=None)
defaults: {u'auth_type': 'password', u'compute_api_version': u'2', 'key': None, u'database_api_version': u'1.0', 'api_timeout': None, u'baremetal_api_version': u'1', u'image_api_version': u'2', 'cacert': None, u'image_api_use_tasks': False, u'floating_ip_source': u'neutron', u'orchestration_api_version': u'1', u'interface': None, u'network_api_version': u'2', u'image_format': u'qcow2', u'key_manager_api_version': u'v1', u'metering_api_version': u'2', 'verify': True, u'identity_api_version': u'2.0', u'volume_api_version': u'2', 'cert': None, u'secgroup_source': u'neutron', u'container_api_version': u'1', u'dns_api_version': u'2', u'object_store_api_version': u'1', u'disable_vendor_agent': {}}
cloud cfg: {'auth_type': 'password', u'compute_api_version': u'2', 'key': None, u'database_api_version': u'1.0', 'data_processing_api_version': '1.1', 'inspector_api_version': '1', u'network_api_version': u'2', u'image_format': u'qcow2', u'image_api_version': u'2', 'clustering_api_version': '1', 'verify': True, u'dns_api_version': '2', u'object_store_api_version': u'1', 'verbose_level': 3, 'region_name': 'RegionOne', 'api_timeout': None, u'baremetal_api_version': '1.6', 'queues_api_version': '1.1', 'auth': {'username': 'admin', 'project_name': 'demo', 'password': '***', 'auth_url': 'http://1.1.1.1:5000/v2.0'}, 'default_domain': 'default', u'container_api_version': u'1', u'image_api_use_tasks': False, u'floating_ip_source': u'neutron', u'orchestration_api_version': '1', 'timing': False, 'application_catalog_api_version': '1', 'cacert': None, u'key_manager_api_version': '1', u'metering_api_version': u'2', 'deferred_help': False, u'identity_api_version': '2.0', 'workflow_api_version': '2', u'volume_api_version': '2', 'cert': None, u'secgroup_source': u'neutron', 'translator_api_version': '1', 'debug': True, u'interface': None, u'disable_vendor_agent': {}}
compute API version 2, cmd group openstack.compute.v2
network API version 2, cmd group openstack.network.v2
image API version 2, cmd group openstack.image.v2
volume API version 2, cmd group openstack.volume.v2
identity API version 2.0, cmd group openstack.identity.v2
object_store API version 1, cmd group openstack.object_store.v1
key_manager API version 1, cmd group openstack.key_manager.v1
application_catalog API version 1, cmd group openstack.application_catalog.v1
baremetal_introspection API version 1, cmd group openstack.baremetal_introspection.v1
messaging API version 1.1, cmd group openstack.messaging.v1
clustering API version 1, cmd group openstack.clustering.v1
dns API version 2, cmd group openstack.dns.v2
baremetal API version 1.6, cmd group openstack.baremetal.v1
orchestration API version 1, cmd group openstack.orchestration.v1
workflow_engine API version 2, cmd group openstack.workflow_engine.v2
translator API version 1, cmd group openstack.translator.v1
data_processing API version 1.1, cmd group openstack.data_processing.v1
command: server add security group -> openstackclient.compute.v2.server.AddServerSecurityGroup
Auth plugin password selected
auth_type: password
Using auth plugin: password
Using parameters {'username': 'admin', 'password': '***', 'project_name': 'demo', 'auth_url': 'http://1.1.1.1:5000/v2.0'}
Get auth_ref
REQ: curl -g -i -X GET http://1.1.1.1:5000/v2.0 -H "Accept: application/json" -H "User-Agent: python-openstackclient keystoneauth1/2.4.1 python-requests/2.9.1 CPython/2.7.6"
Starting new HTTP connection (1): 1.1.1.1
"GET /v2.0 HTTP/1.1" 200 336
RESP: [200] Content-Length: 336 Vary: X-Auth-Token Keep-Alive: timeout=5, max=100 Server: Apache/2.4.7 (Ubuntu) Connection: Keep-Alive Date: Thu, 04 Aug 2016 15:30:18 GMT Content-Type: application/json x-openstack-request-id: req-a3376999-8689-4808-8d00-1f6baa1fce17
RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "http://1.1.1.1:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}}
Making authentication request to http://1.1.1.1:5000/v2.0/tokens
"POST /v2.0/tokens HTTP/1.1" 200 2831
run(Namespace(group='11111111-5bf3-422a-89d6-34af3e38bdbb', server='test-server'))
Instantiating compute client for VAPI Version Major: 2, Minor: 0
Making authentication request to http://1.1.1.1:5000/v2.0/tokens
"POST /v2.0/tokens HTTP/1.1" 200 2831
REQ: curl -g -i -X GET http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers/test-server -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}99a39e0b01ee9dd0aac048f45bca87f61526ed5d"
Starting new HTTP connection (1): 1.1.1.1
"GET /v2.1/11111111111111111111111111111111/servers/test-server HTTP/1.1" 404 86
RESP: [404] Content-Length: 86 X-Compute-Request-Id: req-ec285d68-5015-497d-b077-b3322d4161a9 Vary: X-OpenStack-Nova-API-Version Connection: keep-alive X-Openstack-Nova-Api-Version: 2.1 Date: Thu, 04 Aug 2016 15:30:18 GMT Content-Type: application/json; charset=UTF-8
RESP BODY: {"itemNotFound": {"message": "Instance test-server could not be found.", "code": 404}}
REQ: curl -g -i -X GET http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers?name=test-server -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}99a39e0b01ee9dd0aac048f45bca87f61526ed5d"
"GET /v2.1/11111111111111111111111111111111/servers?name=test-server HTTP/1.1" 200 362
RESP: [200] Content-Length: 362 X-Compute-Request-Id: req-153604b3-ea49-4db7-8841-a0d76c86a6b8 Vary: X-OpenStack-Nova-API-Version Connection: keep-alive X-Openstack-Nova-Api-Version: 2.1 Date: Thu, 04 Aug 2016 15:30:18 GMT Content-Type: application/json
RESP BODY: {"servers": [{"id": "11111111-e4a3-48ec-a0d9-603ca7890dd1", "links": [{"href": "http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1", "rel": "self"}, {"href": "http://1.1.1.1:8774/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1", "rel": "bookmark"}], "name": "test-server"}]}
REQ: curl -g -i -X GET http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1 -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}99a39e0b01ee9dd0aac048f45bca87f61526ed5d"
"GET /v2.1/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1 HTTP/1.1" 200 1855
RESP: [200] Content-Length: 1855 X-Compute-Request-Id: req-addc697f-1b4f-4480-8527-0b09259166bd Vary: X-OpenStack-Nova-API-Version Connection: keep-alive X-Openstack-Nova-Api-Version: 2.1 Date: Thu, 04 Aug 2016 15:30:18 GMT Content-Type: application/json
RESP BODY: {"server": {"status": "ACTIVE", "updated": "2016-08-04T15:04:53Z", "hostId": "d0f4d22886d418c1981e5dceb20d908dbbbed413cf851ac2e960f4b6", "OS-EXT-SRV-ATTR:host": "devstack-ubuntu", "addresses": {"private": [{"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:29:ce:15", "version": 4, "addr": "10.0.0.4", "OS-EXT-IPS:type": "fixed"}, {"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:29:ce:15", "version": 6, "addr": "fd23:2b33:d54:0:f816:3eff:fe29:ce15", "OS-EXT-IPS:type": "fixed"}]}, "links": [{"href": "http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1", "rel": "self"}, {"href": "http://1.1.1.1:8774/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1", "rel": "bookmark"}], "key_name": null, "image": {"id": "ac989b4a-40d0-47ad-9bc2-c1af9ca8e46b", "links": [{"href": "http://1.1.1.1:8774/11111111111111111111111111111111/images/ac989b4a-40d0-47ad-9bc2-c1af9ca8e46b", "rel": "bookmark"}]}, "OS-EXT-STS:task_state": null, "OS-EXT-STS:vm_state": "active", "OS-EXT-SRV-ATTR:instance_name": "instance-00000002", "OS-SRV-USG:launched_at": "2016-08-04T15:04:53.000000", "OS-EXT-SRV-ATTR:hypervisor_hostname": "devstack-ubuntu", "flavor": {"id": "84", "links": [{"href": "http://1.1.1.1:8774/11111111111111111111111111111111/flavors/84", "rel": "bookmark"}]}, "id": "11111111-e4a3-48ec-a0d9-603ca7890dd1", "security_groups": [{"name": "default"}, {"name": "test-group"}], "OS-SRV-USG:terminated_at": null, "OS-EXT-AZ:availability_zone": "nova", "user_id": "5575d6f30def47b0a197a44c77453c1e", "name": "test-server", "created": "2016-08-04T12:17:50Z", "tenant_id": "11111111111111111111111111111111", "OS-DCF:diskConfig": "MANUAL", "os-extended-volumes:volumes_attached": [], "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 1, "config_drive": "True", "metadata": {}}}
REQ: curl -g -i -X GET http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/os-security-groups/11111111-5bf3-422a-89d6-34af3e38bdbb -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}99a39e0b01ee9dd0aac048f45bca87f61526ed5d"
"GET /v2.1/11111111111111111111111111111111/os-security-groups/11111111-5bf3-422a-89d6-34af3e38bdbb HTTP/1.1" 200 179
RESP: [200] Content-Length: 179 X-Compute-Request-Id: req-8bdbfde4-7965-4b4b-8ae4-31cb5ff40a4e Vary: X-OpenStack-Nova-API-Version Connection: keep-alive X-Openstack-Nova-Api-Version: 2.1 Date: Thu, 04 Aug 2016 15:30:18 GMT Content-Type: application/json
RESP BODY: {"security_group": {"rules": [], "tenant_id": "11111111111111111111111111111111", "id": "11111111-5bf3-422a-89d6-34af3e38bdbb", "name": "test-group", "description": "test-group"}}
REQ: curl -g -i -X POST http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1/action -H "User-Agent: python-novaclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}99a39e0b01ee9dd0aac048f45bca87f61526ed5d" -d '{"addSecurityGroup": {"name": "test-group"}}'
"POST /v2.1/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1/action HTTP/1.1" 202 0
RESP: [202] Content-Length: 0 X-Compute-Request-Id: req-6d187bf3-88e5-458c-a762-04fca33b0038 Vary: X-OpenStack-Nova-API-Version Connection: keep-alive X-Openstack-Nova-Api-Version: 2.1 Date: Thu, 04 Aug 2016 15:30:19 GMT Content-Type: application/json
clean_up AddServerSecurityGroup:
END return value: 0
While the remove security group fails
$ openstack --debug server remove security group test-server 11111111-5bf3-422a-89d6-34af3e38bdbb
START with options: ['--debug', 'server', 'remove', 'security', 'group', 'test-server', '11111111-5bf3-422a-89d6-34af3e38bdbb']
options: Namespace(access_token_endpoint='', auth_type='', auth_url='http://1.1.1.1:5000/v2.0', cacert='', client_id='', client_secret='***', cloud='', debug=True, default_domain='default', deferred_help=False, domain_id='', domain_name='', endpoint='', identity_provider='', identity_provider_url='', insecure=None, inspector_api_version='1', inspector_url=None, interface='', log_file=None, os_application_catalog_api_version='1', os_baremetal_api_version='1.6', os_clustering_api_version='1', os_compute_api_version='', os_data_processing_api_version='1.1', os_data_processing_url='', os_dns_api_version='2', os_identity_api_version='2.0', os_image_api_version='', os_key_manager_api_version='1', os_network_api_version='', os_object_api_version='', os_orchestration_api_version='1', os_project_id=None, os_project_name=None, os_queues_api_version='1.1', os_translator_api_version='1', os_volume_api_version='2', os_workflow_api_version='2', password='***', profile=None, project_domain_id='', project_domain_name='', project_id='', project_name='demo', protocol='', region_name='RegionOne', scope='', service_provider_endpoint='', timing=False, token='***', trust_id='', url='', user_domain_id='', user_domain_name='', user_id='', username='admin', verbose_level=3, verify=None)
defaults: {u'auth_type': 'password', u'compute_api_version': u'2', 'key': None, u'database_api_version': u'1.0', 'api_timeout': None, u'baremetal_api_version': u'1', u'image_api_version': u'2', 'cacert': None, u'image_api_use_tasks': False, u'floating_ip_source': u'neutron', u'orchestration_api_version': u'1', u'interface': None, u'network_api_version': u'2', u'image_format': u'qcow2', u'key_manager_api_version': u'v1', u'metering_api_version': u'2', 'verify': True, u'identity_api_version': u'2.0', u'volume_api_version': u'2', 'cert': None, u'secgroup_source': u'neutron', u'container_api_version': u'1', u'dns_api_version': u'2', u'object_store_api_version': u'1', u'disable_vendor_agent': {}}
cloud cfg: {'auth_type': 'password', u'compute_api_version': u'2', 'key': None, u'database_api_version': u'1.0', 'data_processing_api_version': '1.1', 'inspector_api_version': '1', u'network_api_version': u'2', u'image_format': u'qcow2', u'image_api_version': u'2', 'clustering_api_version': '1', 'verify': True, u'dns_api_version': '2', u'object_store_api_version': u'1', 'verbose_level': 3, 'region_name': 'RegionOne', 'api_timeout': None, u'baremetal_api_version': '1.6', 'queues_api_version': '1.1', 'auth': {'username': 'admin', 'project_name': 'demo', 'password': '***', 'auth_url': 'http://1.1.1.1:5000/v2.0'}, 'default_domain': 'default', u'container_api_version': u'1', u'image_api_use_tasks': False, u'floating_ip_source': u'neutron', u'orchestration_api_version': '1', 'timing': False, 'application_catalog_api_version': '1', 'cacert': None, u'key_manager_api_version': '1', u'metering_api_version': u'2', 'deferred_help': False, u'identity_api_version': '2.0', 'workflow_api_version': '2', u'volume_api_version': '2', 'cert': None, u'secgroup_source': u'neutron', 'translator_api_version': '1', 'debug': True, u'interface': None, u'disable_vendor_agent': {}}
compute API version 2, cmd group openstack.compute.v2
network API version 2, cmd group openstack.network.v2
image API version 2, cmd group openstack.image.v2
volume API version 2, cmd group openstack.volume.v2
identity API version 2.0, cmd group openstack.identity.v2
object_store API version 1, cmd group openstack.object_store.v1
key_manager API version 1, cmd group openstack.key_manager.v1
application_catalog API version 1, cmd group openstack.application_catalog.v1
baremetal_introspection API version 1, cmd group openstack.baremetal_introspection.v1
messaging API version 1.1, cmd group openstack.messaging.v1
clustering API version 1, cmd group openstack.clustering.v1
dns API version 2, cmd group openstack.dns.v2
baremetal API version 1.6, cmd group openstack.baremetal.v1
orchestration API version 1, cmd group openstack.orchestration.v1
workflow_engine API version 2, cmd group openstack.workflow_engine.v2
translator API version 1, cmd group openstack.translator.v1
data_processing API version 1.1, cmd group openstack.data_processing.v1
command: server remove security group -> openstackclient.compute.v2.server.RemoveServerSecurityGroup
Auth plugin password selected
auth_type: password
Using auth plugin: password
Using parameters {'username': 'admin', 'password': '***', 'project_name': 'demo', 'auth_url': 'http://1.1.1.1:5000/v2.0'}
Get auth_ref
REQ: curl -g -i -X GET http://1.1.1.1:5000/v2.0 -H "Accept: application/json" -H "User-Agent: python-openstackclient keystoneauth1/2.4.1 python-requests/2.9.1 CPython/2.7.6"
Starting new HTTP connection (1): 1.1.1.1
"GET /v2.0 HTTP/1.1" 200 336
RESP: [200] Content-Length: 336 Vary: X-Auth-Token Keep-Alive: timeout=5, max=100 Server: Apache/2.4.7 (Ubuntu) Connection: Keep-Alive Date: Thu, 04 Aug 2016 15:30:49 GMT Content-Type: application/json x-openstack-request-id: req-77196bf0-b244-46fe-b217-31bf1afaccc8
RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "http://1.1.1.1:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}}
Making authentication request to http://1.1.1.1:5000/v2.0/tokens
"POST /v2.0/tokens HTTP/1.1" 200 2831
run(Namespace(group='11111111-5bf3-422a-89d6-34af3e38bdbb', server='test-server'))
Instantiating compute client for VAPI Version Major: 2, Minor: 0
Making authentication request to http://1.1.1.1:5000/v2.0/tokens
"POST /v2.0/tokens HTTP/1.1" 200 2831
REQ: curl -g -i -X GET http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers/test-server -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}d8b99bc7225e5b1e491e0f7682a6e1d41924b5bc"
Starting new HTTP connection (1): 1.1.1.1
"GET /v2.1/11111111111111111111111111111111/servers/test-server HTTP/1.1" 404 86
RESP: [404] Content-Length: 86 X-Compute-Request-Id: req-fd2849f4-1248-487f-a128-a89886d82206 Vary: X-OpenStack-Nova-API-Version Connection: keep-alive X-Openstack-Nova-Api-Version: 2.1 Date: Thu, 04 Aug 2016 15:30:49 GMT Content-Type: application/json; charset=UTF-8
RESP BODY: {"itemNotFound": {"message": "Instance test-server could not be found.", "code": 404}}
REQ: curl -g -i -X GET http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers?name=test-server -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}d8b99bc7225e5b1e491e0f7682a6e1d41924b5bc"
"GET /v2.1/11111111111111111111111111111111/servers?name=test-server HTTP/1.1" 200 362
RESP: [200] Content-Length: 362 X-Compute-Request-Id: req-61c11caf-01df-48c2-a98d-f740f9059b7c Vary: X-OpenStack-Nova-API-Version Connection: keep-alive X-Openstack-Nova-Api-Version: 2.1 Date: Thu, 04 Aug 2016 15:30:49 GMT Content-Type: application/json
RESP BODY: {"servers": [{"id": "11111111-e4a3-48ec-a0d9-603ca7890dd1", "links": [{"href": "http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1", "rel": "self"}, {"href": "http://1.1.1.1:8774/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1", "rel": "bookmark"}], "name": "test-server"}]}
REQ: curl -g -i -X GET http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1 -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}d8b99bc7225e5b1e491e0f7682a6e1d41924b5bc"
"GET /v2.1/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1 HTTP/1.1" 200 1855
RESP: [200] Content-Length: 1855 X-Compute-Request-Id: req-ca98f39f-2a17-46cc-bcd0-602c02694f9b Vary: X-OpenStack-Nova-API-Version Connection: keep-alive X-Openstack-Nova-Api-Version: 2.1 Date: Thu, 04 Aug 2016 15:30:50 GMT Content-Type: application/json
RESP BODY: {"server": {"status": "ACTIVE", "updated": "2016-08-04T15:04:53Z", "hostId": "d0f4d22886d418c1981e5dceb20d908dbbbed413cf851ac2e960f4b6", "OS-EXT-SRV-ATTR:host": "devstack-ubuntu", "addresses": {"private": [{"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:29:ce:15", "version": 4, "addr": "10.0.0.4", "OS-EXT-IPS:type": "fixed"}, {"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:29:ce:15", "version": 6, "addr": "fd23:2b33:d54:0:f816:3eff:fe29:ce15", "OS-EXT-IPS:type": "fixed"}]}, "links": [{"href": "http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1", "rel": "self"}, {"href": "http://1.1.1.1:8774/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1", "rel": "bookmark"}], "key_name": null, "image": {"id": "ac989b4a-40d0-47ad-9bc2-c1af9ca8e46b", "links": [{"href": "http://1.1.1.1:8774/11111111111111111111111111111111/images/ac989b4a-40d0-47ad-9bc2-c1af9ca8e46b", "rel": "bookmark"}]}, "OS-EXT-STS:task_state": null, "OS-EXT-STS:vm_state": "active", "OS-EXT-SRV-ATTR:instance_name": "instance-00000002", "OS-SRV-USG:launched_at": "2016-08-04T15:04:53.000000", "OS-EXT-SRV-ATTR:hypervisor_hostname": "devstack-ubuntu", "flavor": {"id": "84", "links": [{"href": "http://1.1.1.1:8774/11111111111111111111111111111111/flavors/84", "rel": "bookmark"}]}, "id": "11111111-e4a3-48ec-a0d9-603ca7890dd1", "security_groups": [{"name": "default"}, {"name": "test-group"}], "OS-SRV-USG:terminated_at": null, "OS-EXT-AZ:availability_zone": "nova", "user_id": "5575d6f30def47b0a197a44c77453c1e", "name": "test-server", "created": "2016-08-04T12:17:50Z", "tenant_id": "11111111111111111111111111111111", "OS-DCF:diskConfig": "MANUAL", "os-extended-volumes:volumes_attached": [], "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 1, "config_drive": "True", "metadata": {}}}
REQ: curl -g -i -X GET http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/os-security-groups/11111111-5bf3-422a-89d6-34af3e38bdbb -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}d8b99bc7225e5b1e491e0f7682a6e1d41924b5bc"
"GET /v2.1/11111111111111111111111111111111/os-security-groups/11111111-5bf3-422a-89d6-34af3e38bdbb HTTP/1.1" 200 179
RESP: [200] Content-Length: 179 X-Compute-Request-Id: req-4423d84f-4a45-4eb1-901a-b07d00d2de86 Vary: X-OpenStack-Nova-API-Version Connection: keep-alive X-Openstack-Nova-Api-Version: 2.1 Date: Thu, 04 Aug 2016 15:30:50 GMT Content-Type: application/json
RESP BODY: {"security_group": {"rules": [], "tenant_id": "11111111111111111111111111111111", "id": "11111111-5bf3-422a-89d6-34af3e38bdbb", "name": "test-group", "description": "test-group"}}
<SecurityGroup description=test-group, id=11111111-5bf3-422a-89d6-34af3e38bdbb, name=test-group, rules=[], tenant_id=11111111111111111111111111111111> is not JSON serializable
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 346, in run_subcommand
result = cmd.run(parsed_args)
File "/usr/local/lib/python2.7/dist-packages/openstackclient/common/command.py", line 38, in run
return super(Command, self).run(parsed_args)
File "/usr/local/lib/python2.7/dist-packages/cliff/command.py", line 55, in run
self.take_action(parsed_args)
File "/usr/local/lib/python2.7/dist-packages/openstackclient/compute/v2/server.py", line 1152, in take_action
server.remove_security_group(security_group)
File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/servers.py", line 475, in remove_security_group
return self.manager.remove_security_group(self, security_group)
File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/servers.py", line 1572, in remove_security_group
{'name': security_group})
File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/servers.py", line 1682, in _action
info=info, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/servers.py", line 1693, in _action_return_resp_and_body
return self.api.client.post(url, body=body)
File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 179, in post
return self.request(url, 'POST', **kwargs)
File "/usr/local/lib/python2.7/dist-packages/novaclient/client.py", line 89, in request
**kwargs)
File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 331, in request
resp = super(LegacyJsonAdapter, self).request(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 98, in request
return self.session.request(url, method, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/openstackclient/common/session.py", line 40, in request
resp = super(TimingSession, self).request(url, method, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/positional/__init__.py", line 94, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/session.py", line 417, in request
kwargs['data'] = self._json.encode(json)
File "/usr/lib/python2.7/json/encoder.py", line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python2.7/json/encoder.py", line 270, in iterencode
return _iterencode(o, 0)
File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/session.py", line 71, in default
return super(_JSONEncoder, self).default(o)
File "/usr/lib/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <SecurityGroup description=test-group, id=11111111-5bf3-422a-89d6-34af3e38bdbb, name=test-group, rules=[], tenant_id=11111111111111111111111111111111> is not JSON serializable
clean_up RemoveServerSecurityGroup: <SecurityGroup description=test-group, id=11111111-5bf3-422a-89d6-34af3e38bdbb, name=test-group, rules=[], tenant_id=11111111111111111111111111111111> is not JSON serializable
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/openstackclient/shell.py", line 118, in run
ret_val = super(OpenStackShell, self).run(argv)
File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 226, in run
result = self.run_subcommand(remainder)
File "/usr/local/lib/python2.7/dist-packages/openstackclient/shell.py", line 153, in run_subcommand
ret_value = super(OpenStackShell, self).run_subcommand(argv)
File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 346, in run_subcommand
result = cmd.run(parsed_args)
File "/usr/local/lib/python2.7/dist-packages/openstackclient/common/command.py", line 38, in run
return super(Command, self).run(parsed_args)
File "/usr/local/lib/python2.7/dist-packages/cliff/command.py", line 55, in run
self.take_action(parsed_args)
File "/usr/local/lib/python2.7/dist-packages/openstackclient/compute/v2/server.py", line 1152, in take_action
server.remove_security_group(security_group)
File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/servers.py", line 475, in remove_security_group
return self.manager.remove_security_group(self, security_group)
File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/servers.py", line 1572, in remove_security_group
{'name': security_group})
File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/servers.py", line 1682, in _action
info=info, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/servers.py", line 1693, in _action_return_resp_and_body
return self.api.client.post(url, body=body)
File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 179, in post
return self.request(url, 'POST', **kwargs)
File "/usr/local/lib/python2.7/dist-packages/novaclient/client.py", line 89, in request
**kwargs)
File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 331, in request
resp = super(LegacyJsonAdapter, self).request(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 98, in request
return self.session.request(url, method, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/openstackclient/common/session.py", line 40, in request
resp = super(TimingSession, self).request(url, method, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/positional/__init__.py", line 94, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/session.py", line 417, in request
kwargs['data'] = self._json.encode(json)
File "/usr/lib/python2.7/json/encoder.py", line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python2.7/json/encoder.py", line 270, in iterencode
return _iterencode(o, 0)
File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/session.py", line 71, in default
return super(_JSONEncoder, self).default(o)
File "/usr/lib/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <SecurityGroup description=test-group, id=11111111-5bf3-422a-89d6-34af3e38bdbb, name=test-group, rules=[], tenant_id=11111111111111111111111111111111> is not JSON serializable
END return value: 1
Environment:
1) $ git log -1
commit e16da5130bfb972a91341f88fc0b2a2c87182643
2) Libvirt + KVM (devstack)
3) local (devstack)
4) Neutron turned on with devstack
** Affects: nova
Importance: Undecided
Status: 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/1609865
Title:
Remove security group can not pase security group parameters
Status in OpenStack Compute (nova):
New
Bug description:
openstack --debug server remove security group test-server throws an
exception after getting the security group parameters, while add
security gruop can handle the same situation.
Here is the execution log of add security group:
$ openstack --debug server add security group test-server 11111111-5bf3-422a-89d6-34af3e38bdbb
START with options: ['--debug', 'server', 'add', 'security', 'group', 'test-server', '11111111-5bf3-422a-89d6-34af3e38bdbb']
options: Namespace(access_token_endpoint='', auth_type='', auth_url='http://1.1.1.1:5000/v2.0', cacert='', client_id='', client_secret='***', cloud='', debug=True, default_domain='default', deferred_help=False, domain_id='', domain_name='', endpoint='', identity_provider='', identity_provider_url='', insecure=None, inspector_api_version='1', inspector_url=None, interface='', log_file=None, os_application_catalog_api_version='1', os_baremetal_api_version='1.6', os_clustering_api_version='1', os_compute_api_version='', os_data_processing_api_version='1.1', os_data_processing_url='', os_dns_api_version='2', os_identity_api_version='2.0', os_image_api_version='', os_key_manager_api_version='1', os_network_api_version='', os_object_api_version='', os_orchestration_api_version='1', os_project_id=None, os_project_name=None, os_queues_api_version='1.1', os_translator_api_version='1', os_volume_api_version='2', os_workflow_api_version='2', password='***', profile=None, project_domain_id='', project_domain_name='', project_id='', project_name='demo', protocol='', region_name='RegionOne', scope='', service_provider_endpoint='', timing=False, token='***', trust_id='', url='', user_domain_id='', user_domain_name='', user_id='', username='admin', verbose_level=3, verify=None)
defaults: {u'auth_type': 'password', u'compute_api_version': u'2', 'key': None, u'database_api_version': u'1.0', 'api_timeout': None, u'baremetal_api_version': u'1', u'image_api_version': u'2', 'cacert': None, u'image_api_use_tasks': False, u'floating_ip_source': u'neutron', u'orchestration_api_version': u'1', u'interface': None, u'network_api_version': u'2', u'image_format': u'qcow2', u'key_manager_api_version': u'v1', u'metering_api_version': u'2', 'verify': True, u'identity_api_version': u'2.0', u'volume_api_version': u'2', 'cert': None, u'secgroup_source': u'neutron', u'container_api_version': u'1', u'dns_api_version': u'2', u'object_store_api_version': u'1', u'disable_vendor_agent': {}}
cloud cfg: {'auth_type': 'password', u'compute_api_version': u'2', 'key': None, u'database_api_version': u'1.0', 'data_processing_api_version': '1.1', 'inspector_api_version': '1', u'network_api_version': u'2', u'image_format': u'qcow2', u'image_api_version': u'2', 'clustering_api_version': '1', 'verify': True, u'dns_api_version': '2', u'object_store_api_version': u'1', 'verbose_level': 3, 'region_name': 'RegionOne', 'api_timeout': None, u'baremetal_api_version': '1.6', 'queues_api_version': '1.1', 'auth': {'username': 'admin', 'project_name': 'demo', 'password': '***', 'auth_url': 'http://1.1.1.1:5000/v2.0'}, 'default_domain': 'default', u'container_api_version': u'1', u'image_api_use_tasks': False, u'floating_ip_source': u'neutron', u'orchestration_api_version': '1', 'timing': False, 'application_catalog_api_version': '1', 'cacert': None, u'key_manager_api_version': '1', u'metering_api_version': u'2', 'deferred_help': False, u'identity_api_version': '2.0', 'workflow_api_version': '2', u'volume_api_version': '2', 'cert': None, u'secgroup_source': u'neutron', 'translator_api_version': '1', 'debug': True, u'interface': None, u'disable_vendor_agent': {}}
compute API version 2, cmd group openstack.compute.v2
network API version 2, cmd group openstack.network.v2
image API version 2, cmd group openstack.image.v2
volume API version 2, cmd group openstack.volume.v2
identity API version 2.0, cmd group openstack.identity.v2
object_store API version 1, cmd group openstack.object_store.v1
key_manager API version 1, cmd group openstack.key_manager.v1
application_catalog API version 1, cmd group openstack.application_catalog.v1
baremetal_introspection API version 1, cmd group openstack.baremetal_introspection.v1
messaging API version 1.1, cmd group openstack.messaging.v1
clustering API version 1, cmd group openstack.clustering.v1
dns API version 2, cmd group openstack.dns.v2
baremetal API version 1.6, cmd group openstack.baremetal.v1
orchestration API version 1, cmd group openstack.orchestration.v1
workflow_engine API version 2, cmd group openstack.workflow_engine.v2
translator API version 1, cmd group openstack.translator.v1
data_processing API version 1.1, cmd group openstack.data_processing.v1
command: server add security group -> openstackclient.compute.v2.server.AddServerSecurityGroup
Auth plugin password selected
auth_type: password
Using auth plugin: password
Using parameters {'username': 'admin', 'password': '***', 'project_name': 'demo', 'auth_url': 'http://1.1.1.1:5000/v2.0'}
Get auth_ref
REQ: curl -g -i -X GET http://1.1.1.1:5000/v2.0 -H "Accept: application/json" -H "User-Agent: python-openstackclient keystoneauth1/2.4.1 python-requests/2.9.1 CPython/2.7.6"
Starting new HTTP connection (1): 1.1.1.1
"GET /v2.0 HTTP/1.1" 200 336
RESP: [200] Content-Length: 336 Vary: X-Auth-Token Keep-Alive: timeout=5, max=100 Server: Apache/2.4.7 (Ubuntu) Connection: Keep-Alive Date: Thu, 04 Aug 2016 15:30:18 GMT Content-Type: application/json x-openstack-request-id: req-a3376999-8689-4808-8d00-1f6baa1fce17
RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "http://1.1.1.1:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}}
Making authentication request to http://1.1.1.1:5000/v2.0/tokens
"POST /v2.0/tokens HTTP/1.1" 200 2831
run(Namespace(group='11111111-5bf3-422a-89d6-34af3e38bdbb', server='test-server'))
Instantiating compute client for VAPI Version Major: 2, Minor: 0
Making authentication request to http://1.1.1.1:5000/v2.0/tokens
"POST /v2.0/tokens HTTP/1.1" 200 2831
REQ: curl -g -i -X GET http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers/test-server -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}99a39e0b01ee9dd0aac048f45bca87f61526ed5d"
Starting new HTTP connection (1): 1.1.1.1
"GET /v2.1/11111111111111111111111111111111/servers/test-server HTTP/1.1" 404 86
RESP: [404] Content-Length: 86 X-Compute-Request-Id: req-ec285d68-5015-497d-b077-b3322d4161a9 Vary: X-OpenStack-Nova-API-Version Connection: keep-alive X-Openstack-Nova-Api-Version: 2.1 Date: Thu, 04 Aug 2016 15:30:18 GMT Content-Type: application/json; charset=UTF-8
RESP BODY: {"itemNotFound": {"message": "Instance test-server could not be found.", "code": 404}}
REQ: curl -g -i -X GET http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers?name=test-server -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}99a39e0b01ee9dd0aac048f45bca87f61526ed5d"
"GET /v2.1/11111111111111111111111111111111/servers?name=test-server HTTP/1.1" 200 362
RESP: [200] Content-Length: 362 X-Compute-Request-Id: req-153604b3-ea49-4db7-8841-a0d76c86a6b8 Vary: X-OpenStack-Nova-API-Version Connection: keep-alive X-Openstack-Nova-Api-Version: 2.1 Date: Thu, 04 Aug 2016 15:30:18 GMT Content-Type: application/json
RESP BODY: {"servers": [{"id": "11111111-e4a3-48ec-a0d9-603ca7890dd1", "links": [{"href": "http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1", "rel": "self"}, {"href": "http://1.1.1.1:8774/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1", "rel": "bookmark"}], "name": "test-server"}]}
REQ: curl -g -i -X GET http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1 -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}99a39e0b01ee9dd0aac048f45bca87f61526ed5d"
"GET /v2.1/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1 HTTP/1.1" 200 1855
RESP: [200] Content-Length: 1855 X-Compute-Request-Id: req-addc697f-1b4f-4480-8527-0b09259166bd Vary: X-OpenStack-Nova-API-Version Connection: keep-alive X-Openstack-Nova-Api-Version: 2.1 Date: Thu, 04 Aug 2016 15:30:18 GMT Content-Type: application/json
RESP BODY: {"server": {"status": "ACTIVE", "updated": "2016-08-04T15:04:53Z", "hostId": "d0f4d22886d418c1981e5dceb20d908dbbbed413cf851ac2e960f4b6", "OS-EXT-SRV-ATTR:host": "devstack-ubuntu", "addresses": {"private": [{"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:29:ce:15", "version": 4, "addr": "10.0.0.4", "OS-EXT-IPS:type": "fixed"}, {"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:29:ce:15", "version": 6, "addr": "fd23:2b33:d54:0:f816:3eff:fe29:ce15", "OS-EXT-IPS:type": "fixed"}]}, "links": [{"href": "http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1", "rel": "self"}, {"href": "http://1.1.1.1:8774/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1", "rel": "bookmark"}], "key_name": null, "image": {"id": "ac989b4a-40d0-47ad-9bc2-c1af9ca8e46b", "links": [{"href": "http://1.1.1.1:8774/11111111111111111111111111111111/images/ac989b4a-40d0-47ad-9bc2-c1af9ca8e46b", "rel": "bookmark"}]}, "OS-EXT-STS:task_state": null, "OS-EXT-STS:vm_state": "active", "OS-EXT-SRV-ATTR:instance_name": "instance-00000002", "OS-SRV-USG:launched_at": "2016-08-04T15:04:53.000000", "OS-EXT-SRV-ATTR:hypervisor_hostname": "devstack-ubuntu", "flavor": {"id": "84", "links": [{"href": "http://1.1.1.1:8774/11111111111111111111111111111111/flavors/84", "rel": "bookmark"}]}, "id": "11111111-e4a3-48ec-a0d9-603ca7890dd1", "security_groups": [{"name": "default"}, {"name": "test-group"}], "OS-SRV-USG:terminated_at": null, "OS-EXT-AZ:availability_zone": "nova", "user_id": "5575d6f30def47b0a197a44c77453c1e", "name": "test-server", "created": "2016-08-04T12:17:50Z", "tenant_id": "11111111111111111111111111111111", "OS-DCF:diskConfig": "MANUAL", "os-extended-volumes:volumes_attached": [], "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 1, "config_drive": "True", "metadata": {}}}
REQ: curl -g -i -X GET http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/os-security-groups/11111111-5bf3-422a-89d6-34af3e38bdbb -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}99a39e0b01ee9dd0aac048f45bca87f61526ed5d"
"GET /v2.1/11111111111111111111111111111111/os-security-groups/11111111-5bf3-422a-89d6-34af3e38bdbb HTTP/1.1" 200 179
RESP: [200] Content-Length: 179 X-Compute-Request-Id: req-8bdbfde4-7965-4b4b-8ae4-31cb5ff40a4e Vary: X-OpenStack-Nova-API-Version Connection: keep-alive X-Openstack-Nova-Api-Version: 2.1 Date: Thu, 04 Aug 2016 15:30:18 GMT Content-Type: application/json
RESP BODY: {"security_group": {"rules": [], "tenant_id": "11111111111111111111111111111111", "id": "11111111-5bf3-422a-89d6-34af3e38bdbb", "name": "test-group", "description": "test-group"}}
REQ: curl -g -i -X POST http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1/action -H "User-Agent: python-novaclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}99a39e0b01ee9dd0aac048f45bca87f61526ed5d" -d '{"addSecurityGroup": {"name": "test-group"}}'
"POST /v2.1/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1/action HTTP/1.1" 202 0
RESP: [202] Content-Length: 0 X-Compute-Request-Id: req-6d187bf3-88e5-458c-a762-04fca33b0038 Vary: X-OpenStack-Nova-API-Version Connection: keep-alive X-Openstack-Nova-Api-Version: 2.1 Date: Thu, 04 Aug 2016 15:30:19 GMT Content-Type: application/json
clean_up AddServerSecurityGroup:
END return value: 0
While the remove security group fails
$ openstack --debug server remove security group test-server 11111111-5bf3-422a-89d6-34af3e38bdbb
START with options: ['--debug', 'server', 'remove', 'security', 'group', 'test-server', '11111111-5bf3-422a-89d6-34af3e38bdbb']
options: Namespace(access_token_endpoint='', auth_type='', auth_url='http://1.1.1.1:5000/v2.0', cacert='', client_id='', client_secret='***', cloud='', debug=True, default_domain='default', deferred_help=False, domain_id='', domain_name='', endpoint='', identity_provider='', identity_provider_url='', insecure=None, inspector_api_version='1', inspector_url=None, interface='', log_file=None, os_application_catalog_api_version='1', os_baremetal_api_version='1.6', os_clustering_api_version='1', os_compute_api_version='', os_data_processing_api_version='1.1', os_data_processing_url='', os_dns_api_version='2', os_identity_api_version='2.0', os_image_api_version='', os_key_manager_api_version='1', os_network_api_version='', os_object_api_version='', os_orchestration_api_version='1', os_project_id=None, os_project_name=None, os_queues_api_version='1.1', os_translator_api_version='1', os_volume_api_version='2', os_workflow_api_version='2', password='***', profile=None, project_domain_id='', project_domain_name='', project_id='', project_name='demo', protocol='', region_name='RegionOne', scope='', service_provider_endpoint='', timing=False, token='***', trust_id='', url='', user_domain_id='', user_domain_name='', user_id='', username='admin', verbose_level=3, verify=None)
defaults: {u'auth_type': 'password', u'compute_api_version': u'2', 'key': None, u'database_api_version': u'1.0', 'api_timeout': None, u'baremetal_api_version': u'1', u'image_api_version': u'2', 'cacert': None, u'image_api_use_tasks': False, u'floating_ip_source': u'neutron', u'orchestration_api_version': u'1', u'interface': None, u'network_api_version': u'2', u'image_format': u'qcow2', u'key_manager_api_version': u'v1', u'metering_api_version': u'2', 'verify': True, u'identity_api_version': u'2.0', u'volume_api_version': u'2', 'cert': None, u'secgroup_source': u'neutron', u'container_api_version': u'1', u'dns_api_version': u'2', u'object_store_api_version': u'1', u'disable_vendor_agent': {}}
cloud cfg: {'auth_type': 'password', u'compute_api_version': u'2', 'key': None, u'database_api_version': u'1.0', 'data_processing_api_version': '1.1', 'inspector_api_version': '1', u'network_api_version': u'2', u'image_format': u'qcow2', u'image_api_version': u'2', 'clustering_api_version': '1', 'verify': True, u'dns_api_version': '2', u'object_store_api_version': u'1', 'verbose_level': 3, 'region_name': 'RegionOne', 'api_timeout': None, u'baremetal_api_version': '1.6', 'queues_api_version': '1.1', 'auth': {'username': 'admin', 'project_name': 'demo', 'password': '***', 'auth_url': 'http://1.1.1.1:5000/v2.0'}, 'default_domain': 'default', u'container_api_version': u'1', u'image_api_use_tasks': False, u'floating_ip_source': u'neutron', u'orchestration_api_version': '1', 'timing': False, 'application_catalog_api_version': '1', 'cacert': None, u'key_manager_api_version': '1', u'metering_api_version': u'2', 'deferred_help': False, u'identity_api_version': '2.0', 'workflow_api_version': '2', u'volume_api_version': '2', 'cert': None, u'secgroup_source': u'neutron', 'translator_api_version': '1', 'debug': True, u'interface': None, u'disable_vendor_agent': {}}
compute API version 2, cmd group openstack.compute.v2
network API version 2, cmd group openstack.network.v2
image API version 2, cmd group openstack.image.v2
volume API version 2, cmd group openstack.volume.v2
identity API version 2.0, cmd group openstack.identity.v2
object_store API version 1, cmd group openstack.object_store.v1
key_manager API version 1, cmd group openstack.key_manager.v1
application_catalog API version 1, cmd group openstack.application_catalog.v1
baremetal_introspection API version 1, cmd group openstack.baremetal_introspection.v1
messaging API version 1.1, cmd group openstack.messaging.v1
clustering API version 1, cmd group openstack.clustering.v1
dns API version 2, cmd group openstack.dns.v2
baremetal API version 1.6, cmd group openstack.baremetal.v1
orchestration API version 1, cmd group openstack.orchestration.v1
workflow_engine API version 2, cmd group openstack.workflow_engine.v2
translator API version 1, cmd group openstack.translator.v1
data_processing API version 1.1, cmd group openstack.data_processing.v1
command: server remove security group -> openstackclient.compute.v2.server.RemoveServerSecurityGroup
Auth plugin password selected
auth_type: password
Using auth plugin: password
Using parameters {'username': 'admin', 'password': '***', 'project_name': 'demo', 'auth_url': 'http://1.1.1.1:5000/v2.0'}
Get auth_ref
REQ: curl -g -i -X GET http://1.1.1.1:5000/v2.0 -H "Accept: application/json" -H "User-Agent: python-openstackclient keystoneauth1/2.4.1 python-requests/2.9.1 CPython/2.7.6"
Starting new HTTP connection (1): 1.1.1.1
"GET /v2.0 HTTP/1.1" 200 336
RESP: [200] Content-Length: 336 Vary: X-Auth-Token Keep-Alive: timeout=5, max=100 Server: Apache/2.4.7 (Ubuntu) Connection: Keep-Alive Date: Thu, 04 Aug 2016 15:30:49 GMT Content-Type: application/json x-openstack-request-id: req-77196bf0-b244-46fe-b217-31bf1afaccc8
RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "http://1.1.1.1:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}}
Making authentication request to http://1.1.1.1:5000/v2.0/tokens
"POST /v2.0/tokens HTTP/1.1" 200 2831
run(Namespace(group='11111111-5bf3-422a-89d6-34af3e38bdbb', server='test-server'))
Instantiating compute client for VAPI Version Major: 2, Minor: 0
Making authentication request to http://1.1.1.1:5000/v2.0/tokens
"POST /v2.0/tokens HTTP/1.1" 200 2831
REQ: curl -g -i -X GET http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers/test-server -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}d8b99bc7225e5b1e491e0f7682a6e1d41924b5bc"
Starting new HTTP connection (1): 1.1.1.1
"GET /v2.1/11111111111111111111111111111111/servers/test-server HTTP/1.1" 404 86
RESP: [404] Content-Length: 86 X-Compute-Request-Id: req-fd2849f4-1248-487f-a128-a89886d82206 Vary: X-OpenStack-Nova-API-Version Connection: keep-alive X-Openstack-Nova-Api-Version: 2.1 Date: Thu, 04 Aug 2016 15:30:49 GMT Content-Type: application/json; charset=UTF-8
RESP BODY: {"itemNotFound": {"message": "Instance test-server could not be found.", "code": 404}}
REQ: curl -g -i -X GET http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers?name=test-server -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}d8b99bc7225e5b1e491e0f7682a6e1d41924b5bc"
"GET /v2.1/11111111111111111111111111111111/servers?name=test-server HTTP/1.1" 200 362
RESP: [200] Content-Length: 362 X-Compute-Request-Id: req-61c11caf-01df-48c2-a98d-f740f9059b7c Vary: X-OpenStack-Nova-API-Version Connection: keep-alive X-Openstack-Nova-Api-Version: 2.1 Date: Thu, 04 Aug 2016 15:30:49 GMT Content-Type: application/json
RESP BODY: {"servers": [{"id": "11111111-e4a3-48ec-a0d9-603ca7890dd1", "links": [{"href": "http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1", "rel": "self"}, {"href": "http://1.1.1.1:8774/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1", "rel": "bookmark"}], "name": "test-server"}]}
REQ: curl -g -i -X GET http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1 -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}d8b99bc7225e5b1e491e0f7682a6e1d41924b5bc"
"GET /v2.1/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1 HTTP/1.1" 200 1855
RESP: [200] Content-Length: 1855 X-Compute-Request-Id: req-ca98f39f-2a17-46cc-bcd0-602c02694f9b Vary: X-OpenStack-Nova-API-Version Connection: keep-alive X-Openstack-Nova-Api-Version: 2.1 Date: Thu, 04 Aug 2016 15:30:50 GMT Content-Type: application/json
RESP BODY: {"server": {"status": "ACTIVE", "updated": "2016-08-04T15:04:53Z", "hostId": "d0f4d22886d418c1981e5dceb20d908dbbbed413cf851ac2e960f4b6", "OS-EXT-SRV-ATTR:host": "devstack-ubuntu", "addresses": {"private": [{"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:29:ce:15", "version": 4, "addr": "10.0.0.4", "OS-EXT-IPS:type": "fixed"}, {"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:29:ce:15", "version": 6, "addr": "fd23:2b33:d54:0:f816:3eff:fe29:ce15", "OS-EXT-IPS:type": "fixed"}]}, "links": [{"href": "http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1", "rel": "self"}, {"href": "http://1.1.1.1:8774/11111111111111111111111111111111/servers/11111111-e4a3-48ec-a0d9-603ca7890dd1", "rel": "bookmark"}], "key_name": null, "image": {"id": "ac989b4a-40d0-47ad-9bc2-c1af9ca8e46b", "links": [{"href": "http://1.1.1.1:8774/11111111111111111111111111111111/images/ac989b4a-40d0-47ad-9bc2-c1af9ca8e46b", "rel": "bookmark"}]}, "OS-EXT-STS:task_state": null, "OS-EXT-STS:vm_state": "active", "OS-EXT-SRV-ATTR:instance_name": "instance-00000002", "OS-SRV-USG:launched_at": "2016-08-04T15:04:53.000000", "OS-EXT-SRV-ATTR:hypervisor_hostname": "devstack-ubuntu", "flavor": {"id": "84", "links": [{"href": "http://1.1.1.1:8774/11111111111111111111111111111111/flavors/84", "rel": "bookmark"}]}, "id": "11111111-e4a3-48ec-a0d9-603ca7890dd1", "security_groups": [{"name": "default"}, {"name": "test-group"}], "OS-SRV-USG:terminated_at": null, "OS-EXT-AZ:availability_zone": "nova", "user_id": "5575d6f30def47b0a197a44c77453c1e", "name": "test-server", "created": "2016-08-04T12:17:50Z", "tenant_id": "11111111111111111111111111111111", "OS-DCF:diskConfig": "MANUAL", "os-extended-volumes:volumes_attached": [], "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 1, "config_drive": "True", "metadata": {}}}
REQ: curl -g -i -X GET http://1.1.1.1:8774/v2.1/11111111111111111111111111111111/os-security-groups/11111111-5bf3-422a-89d6-34af3e38bdbb -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}d8b99bc7225e5b1e491e0f7682a6e1d41924b5bc"
"GET /v2.1/11111111111111111111111111111111/os-security-groups/11111111-5bf3-422a-89d6-34af3e38bdbb HTTP/1.1" 200 179
RESP: [200] Content-Length: 179 X-Compute-Request-Id: req-4423d84f-4a45-4eb1-901a-b07d00d2de86 Vary: X-OpenStack-Nova-API-Version Connection: keep-alive X-Openstack-Nova-Api-Version: 2.1 Date: Thu, 04 Aug 2016 15:30:50 GMT Content-Type: application/json
RESP BODY: {"security_group": {"rules": [], "tenant_id": "11111111111111111111111111111111", "id": "11111111-5bf3-422a-89d6-34af3e38bdbb", "name": "test-group", "description": "test-group"}}
<SecurityGroup description=test-group, id=11111111-5bf3-422a-89d6-34af3e38bdbb, name=test-group, rules=[], tenant_id=11111111111111111111111111111111> is not JSON serializable
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 346, in run_subcommand
result = cmd.run(parsed_args)
File "/usr/local/lib/python2.7/dist-packages/openstackclient/common/command.py", line 38, in run
return super(Command, self).run(parsed_args)
File "/usr/local/lib/python2.7/dist-packages/cliff/command.py", line 55, in run
self.take_action(parsed_args)
File "/usr/local/lib/python2.7/dist-packages/openstackclient/compute/v2/server.py", line 1152, in take_action
server.remove_security_group(security_group)
File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/servers.py", line 475, in remove_security_group
return self.manager.remove_security_group(self, security_group)
File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/servers.py", line 1572, in remove_security_group
{'name': security_group})
File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/servers.py", line 1682, in _action
info=info, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/servers.py", line 1693, in _action_return_resp_and_body
return self.api.client.post(url, body=body)
File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 179, in post
return self.request(url, 'POST', **kwargs)
File "/usr/local/lib/python2.7/dist-packages/novaclient/client.py", line 89, in request
**kwargs)
File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 331, in request
resp = super(LegacyJsonAdapter, self).request(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 98, in request
return self.session.request(url, method, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/openstackclient/common/session.py", line 40, in request
resp = super(TimingSession, self).request(url, method, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/positional/__init__.py", line 94, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/session.py", line 417, in request
kwargs['data'] = self._json.encode(json)
File "/usr/lib/python2.7/json/encoder.py", line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python2.7/json/encoder.py", line 270, in iterencode
return _iterencode(o, 0)
File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/session.py", line 71, in default
return super(_JSONEncoder, self).default(o)
File "/usr/lib/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <SecurityGroup description=test-group, id=11111111-5bf3-422a-89d6-34af3e38bdbb, name=test-group, rules=[], tenant_id=11111111111111111111111111111111> is not JSON serializable
clean_up RemoveServerSecurityGroup: <SecurityGroup description=test-group, id=11111111-5bf3-422a-89d6-34af3e38bdbb, name=test-group, rules=[], tenant_id=11111111111111111111111111111111> is not JSON serializable
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/openstackclient/shell.py", line 118, in run
ret_val = super(OpenStackShell, self).run(argv)
File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 226, in run
result = self.run_subcommand(remainder)
File "/usr/local/lib/python2.7/dist-packages/openstackclient/shell.py", line 153, in run_subcommand
ret_value = super(OpenStackShell, self).run_subcommand(argv)
File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 346, in run_subcommand
result = cmd.run(parsed_args)
File "/usr/local/lib/python2.7/dist-packages/openstackclient/common/command.py", line 38, in run
return super(Command, self).run(parsed_args)
File "/usr/local/lib/python2.7/dist-packages/cliff/command.py", line 55, in run
self.take_action(parsed_args)
File "/usr/local/lib/python2.7/dist-packages/openstackclient/compute/v2/server.py", line 1152, in take_action
server.remove_security_group(security_group)
File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/servers.py", line 475, in remove_security_group
return self.manager.remove_security_group(self, security_group)
File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/servers.py", line 1572, in remove_security_group
{'name': security_group})
File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/servers.py", line 1682, in _action
info=info, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/servers.py", line 1693, in _action_return_resp_and_body
return self.api.client.post(url, body=body)
File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 179, in post
return self.request(url, 'POST', **kwargs)
File "/usr/local/lib/python2.7/dist-packages/novaclient/client.py", line 89, in request
**kwargs)
File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 331, in request
resp = super(LegacyJsonAdapter, self).request(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 98, in request
return self.session.request(url, method, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/openstackclient/common/session.py", line 40, in request
resp = super(TimingSession, self).request(url, method, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/positional/__init__.py", line 94, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/session.py", line 417, in request
kwargs['data'] = self._json.encode(json)
File "/usr/lib/python2.7/json/encoder.py", line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python2.7/json/encoder.py", line 270, in iterencode
return _iterencode(o, 0)
File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/session.py", line 71, in default
return super(_JSONEncoder, self).default(o)
File "/usr/lib/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <SecurityGroup description=test-group, id=11111111-5bf3-422a-89d6-34af3e38bdbb, name=test-group, rules=[], tenant_id=11111111111111111111111111111111> is not JSON serializable
END return value: 1
Environment:
1) $ git log -1
commit e16da5130bfb972a91341f88fc0b2a2c87182643
2) Libvirt + KVM (devstack)
3) local (devstack)
4) Neutron turned on with devstack
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1609865/+subscriptions
Follow ups