Merge lp:~jk0/nova/improve-pylint-scores into lp:~hudson-openstack/nova/trunk

Proposed by Josh Kearney
Status: Merged
Approved by: Josh Kearney
Approved revision: 1007
Merged at revision: 1009
Proposed branch: lp:~jk0/nova/improve-pylint-scores
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 68 lines (+9/-10)
2 files modified
bin/nova-compute (+3/-3)
bin/nova-manage (+6/-7)
To merge this branch: bzr merge lp:~jk0/nova/improve-pylint-scores
Reviewer Review Type Date Requested Status
Matt Dietz (community) Approve
Devin Carlen (community) Approve
Review via email: mp+58570@code.launchpad.net

Description of the change

Another small round of pylint clean-up.

To post a comment you must log in.
Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve
Revision history for this message
Matt Dietz (cerberus) wrote :

\o/

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/nova-compute'
2--- bin/nova-compute 2011-02-21 21:59:46 +0000
3+++ bin/nova-compute 2011-04-20 20:27:14 +0000
4@@ -28,11 +28,11 @@
5
6 # If ../nova/__init__.py exists, add ../ to Python search path, so that
7 # it will override what happens to be installed in /usr/(local/)lib/python...
8-possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
9+POSSIBLE_TOPDIR = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
10 os.pardir,
11 os.pardir))
12-if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
13- sys.path.insert(0, possible_topdir)
14+if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'nova', '__init__.py')):
15+ sys.path.insert(0, POSSIBLE_TOPDIR)
16
17 gettext.install('nova', unicode=1)
18
19
20=== modified file 'bin/nova-manage'
21--- bin/nova-manage 2011-04-18 21:21:51 +0000
22+++ bin/nova-manage 2011-04-20 20:27:14 +0000
23@@ -58,7 +58,6 @@
24 import glob
25 import json
26 import os
27-import re
28 import sys
29 import time
30
31@@ -66,11 +65,11 @@
32
33 # If ../nova/__init__.py exists, add ../ to Python search path, so that
34 # it will override what happens to be installed in /usr/(local/)lib/python...
35-possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
36+POSSIBLE_TOPDIR = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
37 os.pardir,
38 os.pardir))
39-if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
40- sys.path.insert(0, possible_topdir)
41+if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'nova', '__init__.py')):
42+ sys.path.insert(0, POSSIBLE_TOPDIR)
43
44 gettext.install('nova', unicode=1)
45
46@@ -809,11 +808,11 @@
47 class InstanceTypeCommands(object):
48 """Class for managing instance types / flavors."""
49
50- def _print_instance_types(self, n, val):
51+ def _print_instance_types(self, name, val):
52 deleted = ('', ', inactive')[val["deleted"] == 1]
53 print ("%s: Memory: %sMB, VCPUS: %s, Storage: %sGB, FlavorID: %s, "
54 "Swap: %sGB, RXTX Quota: %sGB, RXTX Cap: %sMB%s") % (
55- n, val["memory_mb"], val["vcpus"], val["local_gb"],
56+ name, val["memory_mb"], val["vcpus"], val["local_gb"],
57 val["flavorid"], val["swap"], val["rxtx_quota"],
58 val["rxtx_cap"], deleted)
59
60@@ -1021,7 +1020,7 @@
61 machine_images[image_path] = image_metadata
62 else:
63 other_images[image_path] = image_metadata
64- except Exception as exc:
65+ except Exception:
66 print _("Failed to load %(fn)s.") % locals()
67 # NOTE(vish): do kernels and ramdisks first so images
68 self._convert_images(other_images)