Closed Bug 827892 Opened 12 years ago Closed 12 years ago

Each panda should know to which mobile imaging server to talk to

Categories

(Infrastructure & Operations Graveyard :: CIDuty, task, P3)

x86
macOS

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: armenzg, Assigned: armenzg)

References

Details

Attachments

(2 files, 2 obsolete files)

Our configs have hard-coded the address of one of the 10 mobile imaging servers: "mozpool_api_url": "http://mobile-imaging-001.p1.releng.scl1.mozilla.com" I should fix this so we can use the remaining racks that have been allocated for b2g work.
Blocks: 805056
Assignee: nobody → armenzg
Priority: -- → P1
Attached patch remove hardcoded value (obsolete) — Splinter Review
What do you think?
Attachment #699457 - Flags: review?(jhopkins)
Attachment #699457 - Flags: feedback?(aki)
Comment on attachment 699457 [details] [diff] [review] remove hardcoded value >- def query_mozpool_handler(self): >+ def determine_mozpool_host(self, device): >+ fqdn = socket.getfqdn(device) >+ vlan_match = re.search("%s\.p([0-9]+)\.releng.*" % device, fqdn) >+ if vlan_match: >+ vlan = int(vlan_match.group(1)) >+ else: >+ raise MozpoolException("This panda board does not have an associated BMM.") >+ return "http://mobile-imaging-%03i.p%i.releng.scl1.mozilla.com" % (vlan, vlan) Cool, I didn't realize this mapped that way. If you wanted to be super cool you could make "http://mobile-imaging-%03i.p%i.releng.scl1.mozilla.com" part of the config rather than hardcoding here, but this works for now. >+ def query_mozpool_handler(self, device=None, mozpool_api_url=None): > if not self.mozpool_handler: >- if 'mozpool_api_url' not in self.config: >- self.fatal("Can't create mozpool handler without mozpool_api_url set!") >+ assert device != None or mozpool_api_url != None This assert is probably ok, though I'd tend to prefer a human-readable |self.fatal("query_mozpool_handler() requires either a device or mozpool_api_url!")| That may just be me.
Attachment #699457 - Flags: feedback?(aki) → feedback+
Attached patch remove hardcoded value (obsolete) — Splinter Review
I've taken aki's suggestions.
Attachment #699795 - Flags: review?(jhopkins)
Attachment #699795 - Flags: feedback?(aki)
Comment on attachment 699457 [details] [diff] [review] remove hardcoded value Patch is failing unit tests. I will attach the unit test log.
Attachment #699457 - Flags: review?(jhopkins) → review-
Attached file unit test log
Attachment #699457 - Attachment is obsolete: true
Attachment #699795 - Flags: review?(jhopkins)
Attachment #699795 - Flags: feedback?(aki)
This passes the test. I will file a bug for the remaining tests.
Attachment #699795 - Attachment is obsolete: true
Attachment #700573 - Flags: review?(jhopkins)
Priority: P1 → P2
Comment on attachment 700573 [details] [diff] [review] remove mozpool-api-url hardcoded value r+ with one change - move just the assertion of mozpool_api_url to _after_ the |self.mozpool_api_url=| line, as discussed in IRC: + def query_mozpool_handler(self, device=None, mozpool_api_url=None): if not self.mozpool_handler: - if 'mozpool_api_url' not in self.config: - self.fatal("Can't create mozpool handler without mozpool_api_url set!") + assert device != None or mozpool_api_url != None, \ + "query_mozpool_handler() requires either a device or mozpool_api_url!" + self.mozpool_api_url = self.determine_mozpool_host(device) if device else mozpool_api_url
Attachment #700573 - Flags: review?(jhopkins) → review+
Comment on attachment 700573 [details] [diff] [review] remove mozpool-api-url hardcoded value ff4a8964387d
Attachment #700573 - Flags: checked-in+
Priority: P2 → P3
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Product: mozilla.org → Release Engineering
Component: Platform Support → Buildduty
Product: Release Engineering → Infrastructure & Operations
Product: Infrastructure & Operations → Infrastructure & Operations Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: