** Also affects: neutron
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1654887

Title:
  Upgrade to 3.6.0 causes AttributeError: 'SecurityGroup' object has no
  attribute 'keys'

Status in neutron:
  New
Status in python-openstackclient:
  New

Bug description:
  When running the command:

  openstack security group create foo

  Under version 3.5.0 of python-openstackclient the command succeeds,
  but after doing a pip install --upgrade python-openstackclient to
  version 3.6.0 I get the following error:

  'SecurityGroup' object has no attribute 'keys'

  Neutron successfully created the security group.

  Running with --debug shows:

  Using http://172.21.21.125:9696/v2.0 as public network endpoint
  REQ: curl -g -i -X POST http://172.21.21.125:9696/v2.0/security-groups -H 
"User-Agent: openstacksdk/0.9.12 keystoneauth1/2.16.0 python-requests/2.12.4 
CPython/2.7.6" -H "Content-Type: application/json" -H "X-Auth-Token: 
{SHA1}d46c48cdee00c9eefd4216b492f9b56e762749bc" -d '{"security_group": {"name": 
"foo", "description": "foo"}}'
  http://172.21.21.125:9696 "POST /v2.0/security-groups HTTP/1.1" 201 1302
  RESP: [201] Content-Type: application/json Content-Length: 1302 
X-Openstack-Request-Id: req-9bea5358-8341-4064-b7ea-54edd8e4fd53 Date: Sun, 08 
Jan 2017 20:27:07 GMT Connection: keep-alive
  RESP BODY: {"security_group": {"description": "foo", "tenant_id": 
"f0c5bc260c06423893b791890715a337", "created_at": "2017-01-08T20:27:07Z", 
"updated_at": "2017-01-08T20:27:07Z", "security_group_rules": [{"direction": 
"egress", "protocol": null, "description": null, "port_range_max": null, 
"updated_at": "2017-01-08T20:27:07Z", "revision_number": 1, "id": 
"fc82f0ef-df78-4b46-9b9e-96d71b5b34b4", "remote_group_id": null, 
"remote_ip_prefix": null, "created_at": "2017-01-08T20:27:07Z", 
"security_group_id": "b11e40a0-aed2-464e-851e-6901afa0f845", "tenant_id": 
"f0c5bc260c06423893b791890715a337", "port_range_min": null, "ethertype": 
"IPv4", "project_id": "f0c5bc260c06423893b791890715a337"}, {"direction": 
"egress", "protocol": null, "description": null, "port_range_max": null, 
"updated_at": "2017-01-08T20:27:07Z", "revision_number": 1, "id": 
"3e363162-93bf-49c4-9d00-203ffe1dd4ef", "remote_group_id": null, 
"remote_ip_prefix": null, "created_at": "2017-01-08T20:27:07Z", 
"security_group_id": "b
 11e40a0-aed2-464e-851e-6901afa0f845", "tenant_id": 
"f0c5bc260c06423893b791890715a337", "port_range_min": null, "ethertype": 
"IPv6", "project_id": "f0c5bc260c06423893b791890715a337"}], "revision_number": 
1, "project_id": "f0c5bc260c06423893b791890715a337", "id": 
"b11e40a0-aed2-464e-851e-6901afa0f845", "name": "foo"}}

  'SecurityGroup' object has no attribute 'keys'
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 400, in 
run_subcommand
      result = cmd.run(parsed_args)
    File "/usr/local/lib/python2.7/dist-packages/osc_lib/command/command.py", 
line 41, in run
      return super(Command, self).run(parsed_args)
    File "/usr/local/lib/python2.7/dist-packages/cliff/display.py", line 112, 
in run
      column_names, data = self.take_action(parsed_args)
    File 
"/usr/local/lib/python2.7/dist-packages/openstackclient/network/common.py", 
line 188, in take_action
      self.app.client_manager.network, parsed_args)
    File 
"/usr/local/lib/python2.7/dist-packages/openstackclient/network/v2/security_group.py",
 line 145, in take_action_network
      display_columns, property_columns = _get_columns(obj)
    File 
"/usr/local/lib/python2.7/dist-packages/openstackclient/network/v2/security_group.py",
 line 77, in _get_columns
      columns = list(item.keys())
    File "/usr/local/lib/python2.7/dist-packages/openstack/resource2.py", line 
309, in __getattribute__
      return object.__getattribute__(self, name)
  AttributeError: 'SecurityGroup' object has no attribute 'keys'
  clean_up CreateSecurityGroup: 'SecurityGroup' object has no attribute 'keys'
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/osc_lib/shell.py", line 135, 
in run
      ret_val = super(OpenStackShell, self).run(argv)
    File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 279, in run
      result = self.run_subcommand(remainder)
    File "/usr/local/lib/python2.7/dist-packages/osc_lib/shell.py", line 180, 
in run_subcommand
      ret_value = super(OpenStackShell, self).run_subcommand(argv)
    File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 400, in 
run_subcommand
      result = cmd.run(parsed_args)
    File "/usr/local/lib/python2.7/dist-packages/osc_lib/command/command.py", 
line 41, in run
      return super(Command, self).run(parsed_args)
    File "/usr/local/lib/python2.7/dist-packages/cliff/display.py", line 112, 
in run
      column_names, data = self.take_action(parsed_args)
    File 
"/usr/local/lib/python2.7/dist-packages/openstackclient/network/common.py", 
line 188, in take_action
      self.app.client_manager.network, parsed_args)
    File 
"/usr/local/lib/python2.7/dist-packages/openstackclient/network/v2/security_group.py",
 line 145, in take_action_network
      display_columns, property_columns = _get_columns(obj)
    File 
"/usr/local/lib/python2.7/dist-packages/openstackclient/network/v2/security_group.py",
 line 77, in _get_columns
      columns = list(item.keys())
    File "/usr/local/lib/python2.7/dist-packages/openstack/resource2.py", line 
309, in __getattribute__
      return object.__getattribute__(self, name)
  AttributeError: 'SecurityGroup' object has no attribute 'keys'

  END return value: 1

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1654887/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to