Closed Bug 779979 Opened 12 years ago Closed 7 years ago

mozharness should be more explicit about why it can't accept a configuration file with wrong extension

Categories

(Release Engineering :: Applications: MozharnessCore, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(firefox55 fixed)

RESOLVED FIXED
Tracking Status
firefox55 --- fixed

People

(Reporter: wlach, Assigned: wlach)

Details

(Whiteboard: [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/1900] [mozharness])

Attachments

(1 file, 1 obsolete file)

When I try to make a mozharness script use a file which does not end in .json or .py, I currently get the following confusing error:

python scripts/device_talosrunner.py --cfg remotetalos.json
Traceback (most recent call last):
  File "scripts/device_talosrunner.py", line 206, in <module>
    device_talos_runner = DeviceTalosRunner()
  File "scripts/device_talosrunner.py", line 62, in __init__
    require_config_file=require_config_file,
  File "/home/wlach/src/mozharness/mozharness/mozilla/testing/talos.py", line 89, in __init__
    BaseScript.__init__(self, **kwargs)
  File "/home/wlach/src/mozharness/mozharness/base/script.py", line 545, in __init__
    **kwargs)
  File "/home/wlach/src/mozharness/mozharness/base/config.py", line 180, in __init__
    self.parse_args()
  File "/home/wlach/src/mozharness/mozharness/base/config.py", line 330, in parse_args
    self.set_config(parse_config_file(options.config_file))
  File "/home/wlach/src/mozharness/mozharness/base/config.py", line 137, in parse_config_file
    raise RuntimeError, "Unknown config file type %s!" % file_name
Unknown config file type 'talos.config'!

At the least, we could specify what types of files ARE valid (i.e. those ending in .json or .py)
Simple patch with improved error message
Attachment #648477 - Flags: review?(aki)
Comment on attachment 648477 [details] [diff] [review]
Simple patch to improve error message

I'd love to fix parse_config_file, but haven't figured out how yet.
This'll help.
Attachment #648477 - Flags: review?(aki) → review+
Whiteboard: [mozharness]
Will: did you want to check this in?  Want me to?
Product: mozilla.org → Release Engineering
Component: Other → Mozharness
Whiteboard: [mozharness] → [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/1900] [mozharness]
Comment on attachment 648477 [details] [diff] [review]
Simple patch to improve error message

Better late than never? Hopefully autoland/mozreview will make sure it actually gets in this time.
Attachment #648477 - Attachment is obsolete: true
Comment on attachment 8858074 [details]
Bug 779979 - Be more explicit about why mozharness can't accept a config file with wrong extension

https://reviewboard.mozilla.org/r/130058/#review132644
Attachment #8858074 - Flags: review?(aki) → review+
Pushed by wlachance@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5fccdd8de0ae
Be more explicit about why mozharness can't accept a config file with wrong extension r=aki
https://hg.mozilla.org/mozilla-central/rev/5fccdd8de0ae
Status: NEW → RESOLVED
Closed: 7 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: