Fix duplicate ports returned from determine_ports().

This commit is contained in:
Adam Gandelman 2013-08-19 15:58:17 -07:00
parent e7880f17b8
commit 66bf59bbc0
2 changed files with 2 additions and 1 deletions

View File

@ -182,7 +182,7 @@ def determine_ports():
ports.append(API_PORTS[service])
except KeyError:
pass
return ports
return list(set(ports))
def api_port(service):

View File

@ -152,6 +152,7 @@ class NovaCCUtilsTests(CharmTestCase):
def test_determine_ports(self, restart_map):
restart_map.return_value = {
'/etc/nova/nova.conf': ['nova-api-os-compute', 'nova-api-ec2'],
'/etc/nova/api-paste.ini': ['nova-api-os-compute', 'nova-api-ec2'],
'/etc/quantum/quantum.conf': ['quantum-server'],
}
ports = utils.determine_ports()