Closed Bug 819179 Opened 13 years ago Closed 13 years ago

improve environment filtering

Categories

(Testing Graveyard :: Mozpool, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dustin, Assigned: dustin)

Details

Attachments

(1 file)

Right now, requests filter devices by environment the hard way - get all available devices, then look for one with the right environment. This is pretty silly. The data.get_free_devices function should be expanded to take environment as an argument.
Assignee: nobody → dustin
Attached patch bug819179.patch — — Splinter Review
no functionality change, just a refactor
Attachment #693933 - Flags: review?(mcote)
Comment on attachment 693933 [details] [diff] [review] bug819179.patch Review of attachment 693933 [details] [diff] [review]: ----------------------------------------------------------------- Nice. ::: runtests.py @@ +214,5 @@ > + environment='bar', device_name='device2')), > + sorted([ ])) > + self.assertEqual(sorted(data.get_free_devices( > + environment='bar', device_name='device3')), > + sorted([ 'device3' ])) Nit: if we're trying to standardize coding styles in mozpool, there shouldn't be any spaces around [] in Python (according to PEP-8). I realize this is already in a lot of places, but new code should be mostly PEP-8, I'm thinking.
Attachment #693933 - Flags: review?(mcote) → review+
Yeah, bad habit. I blame Buildbot (which is really blaming me..). Fixed and landed.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: