]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fixing silly pep8 error
authorSalvatore Orlando <salvatore.orlando@eu.citrix.com>
Thu, 21 Jul 2011 16:37:24 +0000 (17:37 +0100)
committerSalvatore Orlando <salvatore.orlando@eu.citrix.com>
Thu, 21 Jul 2011 16:37:24 +0000 (17:37 +0100)
1  2 
quantum/plugins/SamplePlugin.py

index 8f46e4373122ca92f4b91c228c1dbb708c7fac5a,376456a6c81dae207c152684f9128cd265a68dbb..b1486bf7c3f1395ba49a0078d666d7c17644c27f
@@@ -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