several potential programming bugs found by pylint

Bug #1037183 reported by Yun Mao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Yun Mao

Bug Description

This is against the current master 2ba710af4f619a9aa3d4d4e377af01f5c6fe39e9

One of them might be a duplicate of #1036419.

File nova/api/openstack/compute/contrib/instance_usage_audit_log.py
Line 53: raise webob.exc.HTTPBadRequest(explanation=msg)
E0602: Undefined variable 'webob'

File nova/console/api.py
Line 46: pool['host'])
E0602: Undefined variable 'pool'

File nova/console/manager.py
Line 126: pool_info = compute_rpcapi.get_console_pool_info(context,
E1101: Module 'nova.compute.rpcapi' has no 'get_console_pool_info' member

File nova/db/sqlalchemy/api.py
Line 1437: instance_ref.instance_type
E1101: Instance of 'Instance' has no 'instance_type' member

File nova/db/sqlalchemy/models.py
Line 84: columns.extend(self._extra_keys())
E1101: Instance of 'NovaBase' has no '_extra_keys' member

File nova/db/sqlalchemy/session.py
Line 95: def connect(delf, dbapi_con, con_record):
E0213: Method should have "self" as first argument

File nova/db/sqlalchemy/migrate_repo/versions/098_update_volume_attach_time.py
Line 67: attach_datetime.drop()
E0602: Undefined variable 'attach_datetime'

File nova/tests/test_bdm.py
Line 30: def fake_ec2_vol_id_to_uuid(obj, ec2_id):
E0213: Method should have "self" as first argument

File nova/tests/test_virt_drivers.py
Line 529: def setUp(self):
E1003: Bad first argument 'ComputeDriver' given to super class

File nova/tests/test_volume.py
Line 611: nova.common.policy.set_brain(nova.common.policy.HttpBrain(rules))
E1101: Module 'nova.common' has no 'policy' member

File nova/tests/test_volume.py
Line 611: nova.common.policy.set_brain(nova.common.policy.HttpBrain(rules))
E1101: Module 'nova.common' has no 'policy' member

File nova/tests/test_xenapi.py
Line 1019: def test_migrate_disk_and_power_off(self):
E0102: method already defined line 1011

File nova/tests/test_xenapi.py
Line 2085: def call_plugin(session_self, service, command, kwargs):
E0213: Method should have "self" as first argument

File nova/tests/test_xenapi.py
Line 2102: actual = self.kwargs['params']['properties']
E1101: Instance of 'VmUtilsTestCase' has no 'kwargs' member

File nova/tests/api/openstack/test_wsgi.py
Line 762: foo() # generate a TypeError
E1120: No value passed for parameter 'a' in function call

File nova/tests/api/openstack/compute/contrib/test_config_drive.py
Line 52: self.asserTrue('config_drive' in server_dict)
E1101: Instance of 'ConfigDriveTest' has no 'asserTrue' member

File nova/tests/api/openstack/compute/contrib/test_hypervisors.py
Line 373: text = serializer.serialize(exemplar)
E1101: Instance of 'HypervisorIndexTemplate' has no 'serialize' member

File nova/tests/api/openstack/compute/contrib/test_hypervisors.py
Line 419: text = serializer.serialize(exemplar)
E1101: Instance of 'HypervisorDetailTemplate' has no 'serialize' member

File nova/tests/api/openstack/compute/contrib/test_hypervisors.py
Line 448: text = serializer.serialize(exemplar)
E1101: Instance of 'HypervisorTemplate' has no 'serialize' member

File nova/tests/api/openstack/compute/contrib/test_hypervisors.py
Line 460: text = serializer.serialize(exemplar)
E1101: Instance of 'HypervisorUptimeTemplate' has no 'serialize' member

File nova/tests/api/openstack/compute/contrib/test_hypervisors.py
Line 483: text = serializer.serialize(exemplar)
E1101: Instance of 'HypervisorServersTemplate' has no 'serialize' member

File nova/tests/api/openstack/compute/contrib/test_hypervisors.py
Line 507: text = serializer.serialize(exemplar)
E1101: Instance of 'HypervisorStatisticsTemplate' has no 'serialize' member

File nova/tests/api/openstack/compute/contrib/test_keypairs.py
Line 197: def test_keypair_create_quota_limit(self):
E0102: method already defined line 126

File nova/tests/api/openstack/compute/contrib/test_keypairs.py
Line 280: self.asserTrue('key_name' in server_dict)
E1101: Instance of 'KeypairsTest' has no 'asserTrue' member

File nova/tests/api/openstack/compute/contrib/test_quota_classes.py
Line 148: text = self.serializer.serialize(exemplar)
E1101: Instance of 'QuotaClassTemplate' has no 'serialize' member

File nova/tests/api/openstack/compute/contrib/test_security_groups.py
Line 1323: return serializer.serialize(body)
E1101: Instance of 'MinimalCreateServerTemplate' has no 'serialize' member

File nova/tests/network/test_manager.py
Line 1704: nova.common.policy.set_brain(nova.common.policy.HttpBrain(rules))
E1101: Module 'nova.common' has no 'policy' member

File nova/tests/network/test_manager.py
Line 1704: nova.common.policy.set_brain(nova.common.policy.HttpBrain(rules))
E1101: Module 'nova.common' has no 'policy' member

File nova/tests/scheduler/test_chance_scheduler.py
Line 101: compute_rpcapi.ComputeAPI.run_instance(ctxt, host='host3',
E1120: No value passed for parameter 'ctxt' in function call

File nova/tests/scheduler/test_chance_scheduler.py
Line 117: compute_rpcapi.ComputeAPI.run_instance(ctxt, host='host1',
E1120: No value passed for parameter 'ctxt' in function call

File nova/tests/scheduler/test_chance_scheduler.py
Line 171: compute_rpcapi.ComputeAPI.run_instance(ctxt, host='host',
E1120: No value passed for parameter 'ctxt' in function call

File nova/tests/scheduler/test_chance_scheduler.py
Line 184: compute_rpcapi.ComputeAPI.run_instance(ctxt, host='host',
E1120: No value passed for parameter 'ctxt' in function call

File nova/tests/scheduler/test_scheduler.py
Line 438: compute_rpcapi.ComputeAPI.live_migration(self.context,
E1120: No value passed for parameter 'ctxt' in function call

File nova/tests/scheduler/test_scheduler.py
Line 504: compute_rpcapi.ComputeAPI.live_migration(self.context,
E1120: No value passed for parameter 'ctxt' in function call

File nova/virt/baremetal/driver.py
Line 132: disk.destroy_container(self.container)
E1101: Instance of 'BareMetalDriver' has no 'container' member

File nova/virt/baremetal/driver.py
Line 258: 'power_state': power_state.FAILED})
E1101: Module 'nova.compute.power_state' has no 'FAILED' member

File nova/virt/disk/mount.py
Line 79: self.error = _('partition search unsupported with %s') % self.mode
E1101: Instance of 'Mount' has no 'mode' member

File nova/virt/libvirt/driver.py
Line 2543: self._cache_image(fn=libvirt_utils.fetch_image,
E1101: Instance of 'LibvirtDriver' has no '_cache_image' member

File nova/virt/vmwareapi/vmware_images.py
Line 106: start_transfer(read_file_handle, file_size,
E1120: No value passed for parameter 'data_size' in function call

File nova/virt/vmwareapi/vmware_images.py
Line 134: start_transfer(read_file_handle, file_size, image_service=image_service,
E1120: No value passed for parameter 'data_size' in function call

File nova/virt/xenapi/fake.py
Line 622: def VM_migrate_send(self, session, mref, migrate_data, live, vdi_map,
E0102: method already defined line 495

File nova/virt/xenapi/vmops.py
Line 419: root_vdi = vm_utils.fetch_blank_disk(self._session,
E1101: Module 'nova.virt.xenapi.vm_utils' has no 'fetch_blank_disk' member

Revision history for this message
Russell Bryant (russellb) wrote :

Some of this is good stuff ... some of it false positives, though

Changed in nova:
status: New → Confirmed
importance: Undecided → Low
Changed in nova:
importance: Low → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/11435

Changed in nova:
assignee: nobody → Russell Bryant (russellb)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/11435
Committed: http://github.com/openstack/nova/commit/ea54ad3dd2053404cb2fbbaa1a3613a5dece6345
Submitter: Jenkins
Branch: master

commit ea54ad3dd2053404cb2fbbaa1a3613a5dece6345
Author: Russell Bryant <email address hidden>
Date: Wed Aug 15 17:08:15 2012 -0400

    Fix use of non-existant var pool.

    This code was using pool, but this variable did not exist. It was
    erroneously removed in f50ce35c9cf2e05d205485586da1cb6d5433ba56.
    This patch fixes the bug, as well as introduces unit tests for this API
    that would have caught the problem.

    Part of bug 1037183.

    Change-Id: I0784aa314a0224198049dbcbe160084bdd1deee1

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
Yun Mao (yunmao) wrote :

One more bug for commit 0272c063bbc32f1ff39f2baa8ae3f0764723ef73:

nova/scheduler/driver.py:174: [E1121, Scheduler.create_instance_db_entry] Too many positional arguments for function call

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/11951

Changed in nova:
assignee: Russell Bryant (russellb) → Yun Mao (yunmao)
status: Fix Committed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/11952

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/11953

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/11954

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/11956

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/11951
Committed: http://github.com/openstack/nova/commit/b11f68ab5e3f57585950736b1202bf07a6e09b12
Submitter: Jenkins
Branch: master

commit b11f68ab5e3f57585950736b1202bf07a6e09b12
Author: Yun Mao <email address hidden>
Date: Fri Aug 24 16:58:12 2012 -0400

    Add missing context argument to start_transfer calls

    The first argument of start_transfer is context. Apparently it
    is missing.

    Partially fix bug 1037183

    Change-Id: I83b30a8f7d275d7675d11bd8dcad76dd7a893deb

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/11953
Committed: http://github.com/openstack/nova/commit/0796d91e68dc29624b1f423b76fa5701b824ac25
Submitter: Jenkins
Branch: master

commit 0796d91e68dc29624b1f423b76fa5701b824ac25
Author: Yun Mao <email address hidden>
Date: Fri Aug 24 17:12:13 2012 -0400

    Use the compute_rpcapi instance not the module

    compute_rpcapi.get_console_pool_info is only available from
    the ComputeAPI object, not nova.compute.rpcapi module.

    Partially fix bug 1037183

    Change-Id: I57df710389bf349c7ba1dd7980105222918bff92

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/11954
Committed: http://github.com/openstack/nova/commit/652d602ebd0b54731f6ce6b2c85ed403a4c5a0cb
Submitter: Jenkins
Branch: master

commit 652d602ebd0b54731f6ce6b2c85ed403a4c5a0cb
Author: Yun Mao <email address hidden>
Date: Fri Aug 24 17:41:10 2012 -0400

    Rename class_name to project_id

    project_id is the variable used in the actual code, which is not
    defined without this patch.
    This bug is never caught because quota_usage_update seems to be
    no longer in use.

    Partially fix bug 1037183

    Change-Id: I42a279489de75128e7acf09fd05873e73846d272

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/11956
Committed: http://github.com/openstack/nova/commit/6e2515f4db3b6b9913e252cd52237574002637f2
Submitter: Jenkins
Branch: master

commit 6e2515f4db3b6b9913e252cd52237574002637f2
Author: Yun Mao <email address hidden>
Date: Fri Aug 24 17:47:03 2012 -0400

    Add missing user_id in revoke_certs_by_user_and_project()

    The correct function signature is
    revoke_certs_by_user_and_project(user_id, project_id)

    Partially fix bug 1037183

    Change-Id: Ia0cf350da9b6d8cab5e43c9897a1614b1b9918e1

Revision history for this message
Yun Mao (yunmao) wrote :

One more bug: Module 'nova.virt.driver' has no 'InstanceInfo' member

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/11962

Changed in nova:
status: Fix Committed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/11963

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/11952
Committed: http://github.com/openstack/nova/commit/d55a71854c8a2fe51d59ae6d082b2e16e4c9844d
Submitter: Jenkins
Branch: master

commit d55a71854c8a2fe51d59ae6d082b2e16e4c9844d
Author: Yun Mao <email address hidden>
Date: Fri Aug 24 17:04:03 2012 -0400

    Remove duplicated method VM_migrate_send

    The correct signature is defined in line 653 later in the code.

    Partially fix bug 1037183

    Change-Id: Ib6904ea962da2bcef391416be4a09801976d8bcd

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/11965

Changed in nova:
status: Fix Committed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/11966

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/11963
Committed: http://github.com/openstack/nova/commit/29bf91d5210de95c5f973a9a039d34b34a584343
Submitter: Jenkins
Branch: master

commit 29bf91d5210de95c5f973a9a039d34b34a584343
Author: Yun Mao <email address hidden>
Date: Fri Aug 24 20:32:58 2012 -0400

    Remove duplicated test_migrate_disk_and_power_off()

    test_migrate_disk_and_power_off() is written exactly twice

    Partially fix bug 1037183

    Change-Id: Ic1f3448d304a5fa64d14fd76a0215c4fb5895774

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/11962
Committed: http://github.com/openstack/nova/commit/487c456897b96a815b68f4fc43c45a586c62fc9a
Submitter: Jenkins
Branch: master

commit 487c456897b96a815b68f4fc43c45a586c62fc9a
Author: Yun Mao <email address hidden>
Date: Fri Aug 24 20:29:15 2012 -0400

    Add missing import webob.exc

    Used in line 55

    Partially fix bug 1037183

    Change-Id: I8b5482b3e29c9099b7bc5203b23048f4e81d6eb4

Changed in nova:
status: Fix Committed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/11978

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/11966
Committed: http://github.com/openstack/nova/commit/72815cfa963e307df9376ec9eeb296dc45b8acbc
Submitter: Jenkins
Branch: master

commit 72815cfa963e307df9376ec9eeb296dc45b8acbc
Author: Yun Mao <email address hidden>
Date: Fri Aug 24 20:51:25 2012 -0400

    Define default mode and device_id_string in Mount

    self.mode is not a valid class member in the Mount abstract class,
    but used in map_dev(). Although all the subclasses define it so
    there is no runtime bug, define it to avoid confusion and
    better readability.

    Do the same thing for device_id_string as precaution too.

    Partially fix bug 1037183

    Change-Id: Ica32db1ca17c6ed967f2c310b1d54adeb5f4247c

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/11965
Committed: http://github.com/openstack/nova/commit/88e3194b2f627b09cc1d2d250b12a088301e84cd
Submitter: Jenkins
Branch: master

commit 88e3194b2f627b09cc1d2d250b12a088301e84cd
Author: Yun Mao <email address hidden>
Date: Fri Aug 24 20:42:10 2012 -0400

    Remove test_keypair_create_quota_limit()

    test_keypair_create_quota_limit() is defined twice. The two tests
    are not exactly the same but functionally equivallent. Remove the
    first definition.

    Partially fix bug 1037183

    Change-Id: I99bd3cd54cf55ff071ced10e931025813d0c92b0

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/12003

Changed in nova:
status: Fix Committed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/12006

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/12006
Committed: http://github.com/openstack/nova/commit/d14fbc5b73b6cc358209b7d071dfe0e144c06132
Submitter: Jenkins
Branch: master

commit d14fbc5b73b6cc358209b7d071dfe0e144c06132
Author: Yun Mao <email address hidden>
Date: Mon Aug 27 12:03:24 2012 -0400

    Fix column variable typo

    attach_datetime is not available during downgrade. It's a copy/paste
    bug from the upgrade function.

    Partially fix bug 1037183

    Change-Id: I97e2cf98a180a6c80e59545a9cda9852fa6ac563

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/12018

Changed in nova:
status: Fix Committed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/12003
Committed: http://github.com/openstack/nova/commit/3c176c3ffaef6fea32d9a8a6e271d2656bf47075
Submitter: Jenkins
Branch: master

commit 3c176c3ffaef6fea32d9a8a6e271d2656bf47075
Author: Yun Mao <email address hidden>
Date: Sat Aug 25 10:34:58 2012 -0400

    Correct live_migration rpc call in test

    self.driver.compute_rpcapi.live_migration should be the correct
    way to issue live_migration call instead of
    compute_rpcapi.ComputeAPI.live_migration, because the ComputeAPI
    is a class, not an instance of the class.
    This technically does not matter because the method is moxed out
    anyway for testing, but still it is confusing.

    Partially fix bug 1037183

    Change-Id: Id41520a44fb9cfc19e269427ee42493e5dc52f5b

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/12018
Committed: http://github.com/openstack/nova/commit/27f6e0db0d1e7ae18a3ac4edff86b0044c2b7a5b
Submitter: Jenkins
Branch: master

commit 27f6e0db0d1e7ae18a3ac4edff86b0044c2b7a5b
Author: Yun Mao <email address hidden>
Date: Mon Aug 27 16:45:36 2012 -0400

    Add the self parameter to NoopFirewallDriver methods

    Following the Python coding convention even though the current
    code works with the *args magic.

    Part of bug 1037183

    Change-Id: I2be815a098913b5879d0d9b3563a55431408431c

Changed in nova:
status: Fix Committed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/11978
Committed: http://github.com/openstack/nova/commit/c9e573955bc6ae22c2508ccc640690828b150152
Submitter: Jenkins
Branch: master

commit c9e573955bc6ae22c2508ccc640690828b150152
Author: Yun Mao <email address hidden>
Date: Sat Aug 25 09:53:38 2012 -0400

    Rename _unplug_vifs to unplug_vifs

    self._vmops is of type VMWareVMOps, which doesn't have unplug_vifs
    defined.

    Partially fix bug 1037183

    Change-Id: I561788fbfea1d221e13850e93593f8b9a96d9f7c

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-rc1 → 2012.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.