From: Salvatore Orlando Date: Thu, 21 Jul 2011 16:37:24 +0000 (+0100) Subject: Fixing silly pep8 error X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=70ed0712c60c4eac92eb77ac6cd8fb26212126c0;p=openstack-build%2Fneutron-build.git Fixing silly pep8 error --- 70ed0712c60c4eac92eb77ac6cd8fb26212126c0 diff --cc quantum/plugins/SamplePlugin.py index 8f46e4373,376456a6c..b1486bf7c --- a/quantum/plugins/SamplePlugin.py +++ b/quantum/plugins/SamplePlugin.py @@@ -233,14 -227,38 +233,14 @@@ class FakePlugin(object) client/cli/api development """ - #static data for networks and ports - _port_dict_1 = { - 1: {'port-id': 1, - 'port-state': 'DOWN', - 'attachment': None}, - 2: {'port-id': 2, - 'port-state': 'UP', - 'attachment': None}} - _port_dict_2 = { - 1: {'port-id': 1, - 'port-state': 'UP', - 'attachment': 'SomeFormOfVIFID'}, - 2: {'port-id': 2, - 'port-state': 'DOWN', - 'attachment': None}} - _networks = {'001': - { - 'net-id': '001', - 'net-name': 'pippotest', - 'net-ports': _port_dict_1}, - '002': - { - 'net-id': '002', - 'net-name': 'cicciotest', - 'net-ports': _port_dict_2}} - def __init__(self): - db.configure_db({'sql_connection':'sqlite:///:memory:'}) - FakePlugin._net_counter = len(FakePlugin._networks) ++ db.configure_db({'sql_connection': 'sqlite:///:memory:'}) + FakePlugin._net_counter = 0 def _get_network(self, tenant_id, network_id): - network = FakePlugin._networks.get(network_id) - if not network: + try: + network = db.network_get(network_id) + except: raise exc.NetworkNotFound(net_id=network_id) return network