[Yahoo-eng-team] [Bug 1373816] [NEW] _get_security_groups_on_port tries to get [0] on a set type

2014-09-25 Thread Jacek Świderski
Public bug reported:

_get_security_groups_on_port checks before that all security groups on port 
belong to tenant - and if there are any that don't fulfill this requirement it 
tries to raise SecurityGroupNotFound but fails with :
TypeError: 'set' object does not support indexing

port_sg_missing = requested_groups - valid_groups
if port_sg_missing:
raise ext_sg.SecurityGroupNotFound(id=str(port_sg_missing[0]))


One thing is the fail itself - but beside I think that message = _("Security 
group %(id)s does not exist"), where id would be a randomly chosen missing id 
isn't really clear in this context and new exception should be created for this 
case.

** Affects: neutron
 Importance: Undecided
 Assignee: Jacek Świderski (jacek-swiderski)
 Status: New


** Tags: sg-fw

** Changed in: neutron
 Assignee: (unassigned) => Jacek Świderski (jacek-swiderski)

** Tags added: sg-fw

** Description changed:

  _get_security_groups_on_port checks before that all security groups on port 
belong to tenant - and if there are any that don't fulfill this requirement it 
tries to raise SecurityGroupNotFound but fails with :
  TypeError: 'set' object does not support indexing
  
- One thing is the fail itself - but beside I think that message =
- _("Security group %(id)s does not exist"), where id would be a randomly
- chosen missing id isn't really clear in this context and new exception
- should be created for this case.
+ port_sg_missing = requested_groups - valid_groups
+ if port_sg_missing:
+ raise ext_sg.SecurityGroupNotFound(id=str(port_sg_missing[0]))
+ 
+ 
+ One thing is the fail itself - but beside I think that message = _("Security 
group %(id)s does not exist"), where id would be a randomly chosen missing id 
isn't really clear in this context and new exception should be created for this 
case.

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

Title:
  _get_security_groups_on_port tries to get [0] on a set type

Status in OpenStack Neutron (virtual network service):
  New

Bug description:
  _get_security_groups_on_port checks before that all security groups on port 
belong to tenant - and if there are any that don't fulfill this requirement it 
tries to raise SecurityGroupNotFound but fails with :
  TypeError: 'set' object does not support indexing

  port_sg_missing = requested_groups - valid_groups
  if port_sg_missing:
  raise ext_sg.SecurityGroupNotFound(id=str(port_sg_missing[0]))

  
  One thing is the fail itself - but beside I think that message = _("Security 
group %(id)s does not exist"), where id would be a randomly chosen missing id 
isn't really clear in this context and new exception should be created for this 
case.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1373816/+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


[Yahoo-eng-team] [Bug 1365751] Re: Use of assert_called_once() instead of assert_called_once_with()

2014-09-23 Thread Jacek Świderski
** Also affects: neutron
   Importance: Undecided
   Status: New

** Changed in: neutron
 Assignee: (unassigned) => Jacek Świderski (jacek-swiderski)

** Changed in: neutron
   Status: New => In Progress

** Description changed:

  mock.assert_called_once() is a noop, it doesn't test anything.
  
  Instead it should be mock.assert_called_once_with()
  
  This occurs in the following places:
-   Nova
+   Nova
      nova/tests/virt/hyperv/test_ioutils.py
      nova/tests/virt/libvirt/test_driver.py
-   Cliff
- cliff/tests/test_app.py
+   Cliff
+ cliff/tests/test_app.py
+   Neutron
+ neutron/tests/unit/services/l3_router/test_l3_apic_plugin.py
+ 
neutron/tests/unit/services/loadbalancer/drivers/radware/test_plugin_driver.py
+ neutron/tests/unit/test_l3_agent.py
+ neutron/tests/unit/ml2/drivers/cisco/apic/test_cisco_apic_sync.py
+ 
neutron/tests/unit/ml2/drivers/cisco/apic/test_cisco_apic_mechanism_driver.py

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

Title:
  Use of assert_called_once() instead of assert_called_once_with()

Status in OpenStack Neutron (virtual network service):
  In Progress
Status in OpenStack Compute (Nova):
  Fix Committed
Status in Command Line Interface Formulation Framework:
  In Progress

Bug description:
  mock.assert_called_once() is a noop, it doesn't test anything.

  Instead it should be mock.assert_called_once_with()

  This occurs in the following places:
    Nova
      nova/tests/virt/hyperv/test_ioutils.py
      nova/tests/virt/libvirt/test_driver.py
    Cliff
  cliff/tests/test_app.py
Neutron
  neutron/tests/unit/services/l3_router/test_l3_apic_plugin.py
  
neutron/tests/unit/services/loadbalancer/drivers/radware/test_plugin_driver.py
  neutron/tests/unit/test_l3_agent.py
  neutron/tests/unit/ml2/drivers/cisco/apic/test_cisco_apic_sync.py
  
neutron/tests/unit/ml2/drivers/cisco/apic/test_cisco_apic_mechanism_driver.py

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1365751/+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


[Yahoo-eng-team] [Bug 1368234] [NEW] faulty way of checking if mock wasn't called

2014-09-11 Thread Jacek Świderski
Public bug reported:

Some UT use .assert_has_calls([]) as a way to check if mock wasn't
called - this doesn't work because assert_has_calls only checks if
passed calls are present in mock_calls and hence it is always true
regardless of whether mock was called or not. This can lead to falsely
passed tests.

** Affects: neutron
 Importance: Undecided
 Assignee: Jacek Świderski (jacek-swiderski)
 Status: New

** Changed in: neutron
 Assignee: (unassigned) => Jacek Świderski (jacek-swiderski)

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

Title:
  faulty way of checking if mock wasn't called

Status in OpenStack Neutron (virtual network service):
  New

Bug description:
  Some UT use .assert_has_calls([]) as a way to check if mock
  wasn't called - this doesn't work because assert_has_calls only checks
  if passed calls are present in mock_calls and hence it is always true
  regardless of whether mock was called or not. This can lead to falsely
  passed tests.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1368234/+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


[Yahoo-eng-team] [Bug 1366719] [NEW] security_group_rules direction bad 'allow_put' value

2014-09-08 Thread Jacek Świderski
Public bug reported:

Even though there is no option to update security_group_rules, there is
'direction': {'allow_post': True, 'allow_put': True,
  'is_visible': True,
  'validate': {'type:values': ['ingress', 'egress']}},
which 'allow_put': True suggests it may be updated.

** Affects: neutron
 Importance: Undecided
 Assignee: Jacek Świderski (jacek-swiderski)
 Status: New

** Changed in: neutron
 Assignee: (unassigned) => Jacek Świderski (jacek-swiderski)

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

Title:
  security_group_rules direction bad 'allow_put' value

Status in OpenStack Neutron (virtual network service):
  New

Bug description:
  Even though there is no option to update security_group_rules, there is
  'direction': {'allow_post': True, 'allow_put': True,
'is_visible': True,
'validate': {'type:values': ['ingress', 'egress']}},
  which 'allow_put': True suggests it may be updated.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1366719/+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


[Yahoo-eng-team] [Bug 1363064] [NEW] Cannot set only one of IPv6 attributes while second is None

2014-08-29 Thread Jacek Świderski
Public bug reported:

When trying to update ipv6 subnet's (created with default None
attributes) ra_mode or address_mode operation is not permited (although
it should be) :

neutron subnet-create --ip-version 6 Test fe80:::/40

+---+---+
| Field | Value 
|
+---+---+
| allocation_pools  | {"start": "fe80:::2", "end": 
"fe80::ff:::::fffe"} |
| cidr  | fe80:::/40
|
| dns_nameservers   |   
|
| enable_dhcp   | True  
|
| gateway_ip| fe80:::1  
|
| host_routes   |   
|
| id| 720d4f22-ee49-40c9-a865-cb31defcf6bd  
|
| ip_version| 6 
|
| ipv6_address_mode |   
|
| ipv6_ra_mode  |   
|
| name  |   
|
| network_id| 124826a4-77ed-4682-8e39-d9090689cb85  
|
| tenant_id | d2b47b4677fb4e30ad1961fb7d51ffdc  
|
+---+---+

neutron subnet-update 720d4f22-ee49-40c9-a865-cb31defcf6bd --ipv6_address_mode 
slaac
Invalid input for operation: ipv6_ra_mode set to 'None' with ipv6_address_mode 
set to 'slaac' is not valid. If both attributes are set, they must be the same 
value.

neutron subnet-update 720d4f22-ee49-40c9-a865-cb31defcf6bd --ipv6_ra_mode slaac
Invalid input for operation: ipv6_ra_mode set to 'slaac' with ipv6_address_mode 
set to 'None' is not valid. If both attributes are set, they must be the same 
value.

Clearly as message states leaving one attribute not set should be allowed (also 
I've found spec where attributes combinations are disccused)
http://specs.openstack.org/openstack/neutron-specs/specs/juno/ipv6-radvd-ra.html

** Affects: neutron
 Importance: Undecided
 Assignee: Jacek Świderski (jacek-swiderski)
 Status: Confirmed


** Tags: ipv6

** Tags added: ipv6

** Changed in: neutron
   Status: New => Confirmed

** Changed in: neutron
 Assignee: (unassigned) => Jacek Świderski (jacek-swiderski)

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

Title:
  Cannot set only one of IPv6 attributes while second is None

Status in OpenStack Neutron (virtual network service):
  Confirmed

Bug description:
  When trying to update ipv6 subnet's (created with default None
  attributes) ra_mode or address_mode operation is not permited
  (although it should be) :

  neutron subnet-create --ip-version 6 Test fe80:::/40

  
+---+---+
  | Field | Value   
  |
  
+---+---+
  | allocation_pools  | {"start": "fe80:::2", "end": 
"fe80::ff:::::fffe"} |
  | cidr  | fe80:::/40  
  |
  | dns_nameservers   | 
  |
  | enable_dhcp   | True
  |
  | gateway_ip| fe80:::1
  |
  | host_routes   | 
  |
  | id| 720d4f22-ee49-40c9-a865-cb31defcf6bd
  |
  | ip_version| 6   
  |
  | ipv6_address_mode | 
  |
  | ipv6_ra_mode  | 
  |
  | name