Closed Bug 1126503 Opened 9 years ago Closed 8 years ago

Add authenticated tooltool fetching for mozharness builds

Categories

(Release Engineering :: Applications: MozharnessCore, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: armenzg, Assigned: sfink)

References

Details

Attachments

(1 file)

In bug 1086672 we will be able to fetch files from tooltool.
The trick that I used there is in here.

> tooltool = self.query_exe('tooltool.py', return_type='list')
> cmd = tooltool	
>
> if self.config.get("developer_mode"):
>     if not os.path.exists(str(tooltool)) and \
>         self.config.get("tooltool_py_url"):
>         tooltool = self._retrieve_tooltool(
>                  self.config.get("tooltool_py_url")
>         )
>     cmd = [tooltool,
>            "--authentication-file",
>            get_credentials_path()]
Blocks: 1126534
I'm unclear on what this bug is for, since the code quoted above is in the current tree.

This patch fixes the type handling of the code. query_exe is returning a list, so os.path.exists(str(tooltool)) is actually looking for a file named '[/path/to/tooltool.py]', which is very unlikely to exist, so in practice developer mode always re-fetches tooltool.

Oh. Argh. I just remember why I ran into this, and it's because currently tooltool fails if you do not have an auth file. Even when the auth is unnecessary for what you're fetching (now that we have a truly public server.) So this patch mixes in another change: if the auth file doesn't exist, --authentication-file is not passed at all. I can split that out into a separate bug if you'd prefer, but you're probably the right person to review that change too.
Attachment #8600044 - Flags: review?(armenzg)
Assignee: nobody → sphink
Status: NEW → ASSIGNED
Comment on attachment 8600044 [details] [diff] [review]
Fix tooltool command list handling

Let's start by fixing your issue and then with the missing auth file.
Good catch btw!
We can use a separate bug if you prefer to.
Attachment #8600044 - Flags: review?(armenzg) → review+
Blocks: 1161794
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: