Merge lp:~jshepher/nova/pylint-no-wildcard-imports into lp:~hudson-openstack/nova/trunk

Proposed by Justin Shepherd
Status: Merged
Approved by: Vish Ishaya
Approved revision: 1067
Merged at revision: 1064
Proposed branch: lp:~jshepher/nova/pylint-no-wildcard-imports
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 302 lines (+24/-79)
15 files modified
nova/db/sqlalchemy/migrate_repo/versions/001_austin.py (+3/-5)
nova/db/sqlalchemy/migrate_repo/versions/002_bexar.py (+2/-5)
nova/db/sqlalchemy/migrate_repo/versions/003_add_label_to_networks.py (+1/-6)
nova/db/sqlalchemy/migrate_repo/versions/004_add_zone_tables.py (+2/-5)
nova/db/sqlalchemy/migrate_repo/versions/005_add_instance_metadata.py (+2/-5)
nova/db/sqlalchemy/migrate_repo/versions/006_add_provider_data_to_volumes.py (+1/-5)
nova/db/sqlalchemy/migrate_repo/versions/007_add_ipv6_to_fixed_ips.py (+1/-6)
nova/db/sqlalchemy/migrate_repo/versions/008_add_instance_types.py (+2/-7)
nova/db/sqlalchemy/migrate_repo/versions/009_add_instance_migrations.py (+2/-4)
nova/db/sqlalchemy/migrate_repo/versions/010_add_os_type_to_instances.py (+1/-6)
nova/db/sqlalchemy/migrate_repo/versions/011_live_migration.py (+2/-3)
nova/db/sqlalchemy/migrate_repo/versions/012_add_ipv6_flatmanager.py (+2/-6)
nova/db/sqlalchemy/migrate_repo/versions/013_add_flavors_to_migrations.py (+1/-5)
nova/db/sqlalchemy/migrate_repo/versions/014_add_instance_type_id_to_instances.py (+1/-6)
nova/db/sqlalchemy/migrate_repo/versions/015_add_auto_assign_to_floating_ips.py (+1/-5)
To merge this branch: bzr merge lp:~jshepher/nova/pylint-no-wildcard-imports
Reviewer Review Type Date Requested Status
Brian Lamar (community) Approve
Vish Ishaya (community) Approve
Christopher MacGown (community) Approve
Review via email: mp+60572@code.launchpad.net

Commit message

Bluprint URL: https://blueprints.launchpad.net/nova/+spec/improve-pylint-scores/

These changes quiet down 15 of the top 20 pylint offenders when sorted by number (as of Build #882).

Updated all of the sqlalchemy/migrate_repo/versions files, and removed all unused imports as well as replaced the sqlalchemy wildcard import with explicit imports.

Description of the change

Bluprint URL: https://blueprints.launchpad.net/nova/+spec/improve-pylint-scores/

These changes quiet down 15 of the top 20 pylint offenders when sorted by number (as of Build #882).

Updated all of the sqlalchemy/migrate_repo/versions files, and removed all unused imports as well as replaced the sqlalchemy wildcard import with explicit imports.

To post a comment you must log in.
Revision history for this message
Brian Lamar (blamar) wrote :

Can you remove the commented-out imports? Otherwise I'm a big fan of removing wildcard imports. Thanks!

review: Needs Fixing
1067. By Justin Shepherd

Removed commented out 'from nova import log as logging' line, per request from Brian Lamar

Revision history for this message
Justin Shepherd (jshepher) wrote :

Not a problem.

There were a handful of the files that used logging calls, so I left the others in place to ease future use.

I have removed the commented out 'from nova import log as logging' lines from the following files:

nova/db/sqlalchemy/migrate_repo/versions/003_add_label_to_networks.py
nova/db/sqlalchemy/migrate_repo/versions/006_add_provider_data_to_volumes.py
nova/db/sqlalchemy/migrate_repo/versions/007_add_ipv6_to_fixed_ips.py
nova/db/sqlalchemy/migrate_repo/versions/010_add_os_type_to_instances.py
nova/db/sqlalchemy/migrate_repo/versions/012_add_ipv6_flatmanager.py
nova/db/sqlalchemy/migrate_repo/versions/013_add_flavors_to_migrations.py
nova/db/sqlalchemy/migrate_repo/versions/015_add_auto_assign_to_floating_ips.py

Revision history for this message
Christopher MacGown (0x44) wrote :

Looks good after Brian's requested fixes.

review: Approve
Revision history for this message
Vish Ishaya (vishvananda) wrote :

lgtm as well. Fixes are in, so I'm approving.

review: Approve
Revision history for this message
Brian Lamar (blamar) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/db/sqlalchemy/migrate_repo/versions/001_austin.py'
2--- nova/db/sqlalchemy/migrate_repo/versions/001_austin.py 2011-02-14 13:02:58 +0000
3+++ nova/db/sqlalchemy/migrate_repo/versions/001_austin.py 2011-05-11 17:36:30 +0000
4@@ -17,15 +17,13 @@
5 # under the License.
6
7 ## Table code mostly autogenerated by genmodel.py
8-from sqlalchemy import *
9-from migrate import *
10-
11+from sqlalchemy import Boolean, Column, DateTime, ForeignKey
12+from sqlalchemy import ForeignKeyConstraint, Integer, MetaData, String
13+from sqlalchemy import Table, Text
14 from nova import log as logging
15
16-
17 meta = MetaData()
18
19-
20 auth_tokens = Table('auth_tokens', meta,
21 Column('created_at', DateTime(timezone=False)),
22 Column('updated_at', DateTime(timezone=False)),
23
24=== modified file 'nova/db/sqlalchemy/migrate_repo/versions/002_bexar.py'
25--- nova/db/sqlalchemy/migrate_repo/versions/002_bexar.py 2011-02-22 04:16:52 +0000
26+++ nova/db/sqlalchemy/migrate_repo/versions/002_bexar.py 2011-05-11 17:36:30 +0000
27@@ -16,15 +16,12 @@
28 # License for the specific language governing permissions and limitations
29 # under the License.
30
31-from sqlalchemy import *
32-from migrate import *
33-
34+from sqlalchemy import Boolean, Column, DateTime, ForeignKey
35+from sqlalchemy import Integer, MetaData, String, Table, Text
36 from nova import log as logging
37
38-
39 meta = MetaData()
40
41-
42 # Just for the ForeignKey and column creation to succeed, these are not the
43 # actual definitions of instances or services.
44 instances = Table('instances', meta,
45
46=== modified file 'nova/db/sqlalchemy/migrate_repo/versions/003_add_label_to_networks.py'
47--- nova/db/sqlalchemy/migrate_repo/versions/003_add_label_to_networks.py 2011-02-17 19:10:37 +0000
48+++ nova/db/sqlalchemy/migrate_repo/versions/003_add_label_to_networks.py 2011-05-11 17:36:30 +0000
49@@ -15,15 +15,10 @@
50 # License for the specific language governing permissions and limitations
51 # under the License.
52
53-from sqlalchemy import *
54-from migrate import *
55-
56-from nova import log as logging
57-
58+from sqlalchemy import Column, Integer, MetaData, String, Table
59
60 meta = MetaData()
61
62-
63 networks = Table('networks', meta,
64 Column('id', Integer(), primary_key=True, nullable=False),
65 )
66
67=== modified file 'nova/db/sqlalchemy/migrate_repo/versions/004_add_zone_tables.py'
68--- nova/db/sqlalchemy/migrate_repo/versions/004_add_zone_tables.py 2011-02-17 21:51:24 +0000
69+++ nova/db/sqlalchemy/migrate_repo/versions/004_add_zone_tables.py 2011-05-11 17:36:30 +0000
70@@ -13,15 +13,12 @@
71 # License for the specific language governing permissions and limitations
72 # under the License.
73
74-from sqlalchemy import *
75-from migrate import *
76-
77+from sqlalchemy import Boolean, Column, DateTime, Integer
78+from sqlalchemy import MetaData, String, Table
79 from nova import log as logging
80
81-
82 meta = MetaData()
83
84-
85 #
86 # New Tables
87 #
88
89=== modified file 'nova/db/sqlalchemy/migrate_repo/versions/005_add_instance_metadata.py'
90--- nova/db/sqlalchemy/migrate_repo/versions/005_add_instance_metadata.py 2011-02-18 18:14:56 +0000
91+++ nova/db/sqlalchemy/migrate_repo/versions/005_add_instance_metadata.py 2011-05-11 17:36:30 +0000
92@@ -15,15 +15,12 @@
93 # License for the specific language governing permissions and limitations
94 # under the License.
95
96-from sqlalchemy import *
97-from migrate import *
98-
99+from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer
100+from sqlalchemy import MetaData, String, Table
101 from nova import log as logging
102
103-
104 meta = MetaData()
105
106-
107 # Just for the ForeignKey and column creation to succeed, these are not the
108 # actual definitions of instances or services.
109 instances = Table('instances', meta,
110
111=== modified file 'nova/db/sqlalchemy/migrate_repo/versions/006_add_provider_data_to_volumes.py'
112--- nova/db/sqlalchemy/migrate_repo/versions/006_add_provider_data_to_volumes.py 2011-02-18 18:57:19 +0000
113+++ nova/db/sqlalchemy/migrate_repo/versions/006_add_provider_data_to_volumes.py 2011-05-11 17:36:30 +0000
114@@ -15,11 +15,7 @@
115 # License for the specific language governing permissions and limitations
116 # under the License.
117
118-from sqlalchemy import *
119-from migrate import *
120-
121-from nova import log as logging
122-
123+from sqlalchemy import Column, Integer, MetaData, String, Table
124
125 meta = MetaData()
126
127
128=== modified file 'nova/db/sqlalchemy/migrate_repo/versions/007_add_ipv6_to_fixed_ips.py'
129--- nova/db/sqlalchemy/migrate_repo/versions/007_add_ipv6_to_fixed_ips.py 2011-03-14 19:09:57 +0000
130+++ nova/db/sqlalchemy/migrate_repo/versions/007_add_ipv6_to_fixed_ips.py 2011-05-11 17:36:30 +0000
131@@ -13,15 +13,10 @@
132 # License for the specific language governing permissions and limitations
133 # under the License.
134
135-from sqlalchemy import *
136-from migrate import *
137-
138-from nova import log as logging
139-
140+from sqlalchemy import Column, Integer, MetaData, String, Table
141
142 meta = MetaData()
143
144-
145 # Table stub-definitions
146 # Just for the ForeignKey and column creation to succeed, these are not the
147 # actual definitions of instances or services.
148
149=== modified file 'nova/db/sqlalchemy/migrate_repo/versions/008_add_instance_types.py'
150--- nova/db/sqlalchemy/migrate_repo/versions/008_add_instance_types.py 2011-03-23 18:04:53 +0000
151+++ nova/db/sqlalchemy/migrate_repo/versions/008_add_instance_types.py 2011-05-11 17:36:30 +0000
152@@ -13,15 +13,10 @@
153 # License for the specific language governing permissions and limitations
154 # under the License.
155
156-from sqlalchemy import *
157-from migrate import *
158-
159-from nova import api
160-from nova import db
161+from sqlalchemy import Boolean, Column, DateTime, Integer
162+from sqlalchemy import MetaData, String, Table
163 from nova import log as logging
164
165-import datetime
166-
167 meta = MetaData()
168
169
170
171=== modified file 'nova/db/sqlalchemy/migrate_repo/versions/009_add_instance_migrations.py'
172--- nova/db/sqlalchemy/migrate_repo/versions/009_add_instance_migrations.py 2011-03-03 19:18:37 +0000
173+++ nova/db/sqlalchemy/migrate_repo/versions/009_add_instance_migrations.py 2011-05-11 17:36:30 +0000
174@@ -15,12 +15,10 @@
175 # License for the specific language governing permissions and limitations
176 # under the License.from sqlalchemy import *
177
178-from sqlalchemy import *
179-from migrate import *
180-
181+from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer
182+from sqlalchemy import MetaData, String, Table
183 from nova import log as logging
184
185-
186 meta = MetaData()
187
188 # Just for the ForeignKey and column creation to succeed, these are not the
189
190=== modified file 'nova/db/sqlalchemy/migrate_repo/versions/010_add_os_type_to_instances.py'
191--- nova/db/sqlalchemy/migrate_repo/versions/010_add_os_type_to_instances.py 2011-03-09 21:46:27 +0000
192+++ nova/db/sqlalchemy/migrate_repo/versions/010_add_os_type_to_instances.py 2011-05-11 17:36:30 +0000
193@@ -14,12 +14,7 @@
194 # License for the specific language governing permissions and limitations
195 # under the License.
196
197-from sqlalchemy import *
198-from sqlalchemy.sql import text
199-from migrate import *
200-
201-from nova import log as logging
202-
203+from sqlalchemy import Column, Integer, MetaData, String, Table
204
205 meta = MetaData()
206
207
208=== modified file 'nova/db/sqlalchemy/migrate_repo/versions/011_live_migration.py'
209--- nova/db/sqlalchemy/migrate_repo/versions/011_live_migration.py 2011-03-14 17:59:41 +0000
210+++ nova/db/sqlalchemy/migrate_repo/versions/011_live_migration.py 2011-05-11 17:36:30 +0000
211@@ -16,10 +16,9 @@
212 # License for the specific language governing permissions and limitations
213 # under the License.
214
215-from migrate import *
216+from sqlalchemy import Boolean, Column, DateTime, Integer, MetaData
217+from sqlalchemy import Table, Text
218 from nova import log as logging
219-from sqlalchemy import *
220-
221
222 meta = MetaData()
223
224
225=== modified file 'nova/db/sqlalchemy/migrate_repo/versions/012_add_ipv6_flatmanager.py'
226--- nova/db/sqlalchemy/migrate_repo/versions/012_add_ipv6_flatmanager.py 2011-03-23 04:14:54 +0000
227+++ nova/db/sqlalchemy/migrate_repo/versions/012_add_ipv6_flatmanager.py 2011-05-11 17:36:30 +0000
228@@ -13,15 +13,11 @@
229 # License for the specific language governing permissions and limitations
230 # under the License.
231
232-from sqlalchemy import *
233-from migrate import *
234-
235-from nova import log as logging
236-
237+from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer
238+from sqlalchemy import MetaData, String, Table
239
240 meta = MetaData()
241
242-
243 # Table stub-definitions
244 # Just for the ForeignKey and column creation to succeed, these are not the
245 # actual definitions of instances or services.
246
247=== modified file 'nova/db/sqlalchemy/migrate_repo/versions/013_add_flavors_to_migrations.py'
248--- nova/db/sqlalchemy/migrate_repo/versions/013_add_flavors_to_migrations.py 2011-03-23 18:59:24 +0000
249+++ nova/db/sqlalchemy/migrate_repo/versions/013_add_flavors_to_migrations.py 2011-05-11 17:36:30 +0000
250@@ -15,11 +15,7 @@
251 # License for the specific language governing permissions and limitations
252 # under the License.from sqlalchemy import *
253
254-from sqlalchemy import *
255-from migrate import *
256-
257-from nova import log as logging
258-
259+from sqlalchemy import Column, Integer, MetaData, Table
260
261 meta = MetaData()
262
263
264=== modified file 'nova/db/sqlalchemy/migrate_repo/versions/014_add_instance_type_id_to_instances.py'
265--- nova/db/sqlalchemy/migrate_repo/versions/014_add_instance_type_id_to_instances.py 2011-04-19 21:24:01 +0000
266+++ nova/db/sqlalchemy/migrate_repo/versions/014_add_instance_type_id_to_instances.py 2011-05-11 17:36:30 +0000
267@@ -14,16 +14,11 @@
268 # License for the specific language governing permissions and limitations
269 # under the License.
270
271-from sqlalchemy import *
272-from sqlalchemy.sql import text
273-from migrate import *
274-
275+from sqlalchemy import Column, Integer, MetaData, String, Table
276 #from nova import log as logging
277
278-
279 meta = MetaData()
280
281-
282 c_instance_type = Column('instance_type',
283 String(length=255, convert_unicode=False,
284 assert_unicode=None, unicode_error=None,
285
286=== modified file 'nova/db/sqlalchemy/migrate_repo/versions/015_add_auto_assign_to_floating_ips.py'
287--- nova/db/sqlalchemy/migrate_repo/versions/015_add_auto_assign_to_floating_ips.py 2011-04-21 18:23:40 +0000
288+++ nova/db/sqlalchemy/migrate_repo/versions/015_add_auto_assign_to_floating_ips.py 2011-05-11 17:36:30 +0000
289@@ -15,14 +15,10 @@
290 # License for the specific language governing permissions and limitations
291 # under the License.
292
293-from sqlalchemy import *
294-from sqlalchemy.sql import text
295-from migrate import *
296-
297+from sqlalchemy import Boolean, Column, MetaData, Table
298
299 meta = MetaData()
300
301-
302 c_auto_assigned = Column('auto_assigned', Boolean, default=False)
303
304