provisioner / Provisioner

The is the central location for the Provisioner Module for VoIP/PBX Servers. Most of the new work is happening inside the v5-dev branch
Other
120 stars 155 forks source link

Add option to select firmware #38

Open tm1000 opened 12 years ago

tm1000 commented 12 years ago

Allow users to select old or new firmware in system. Change files accordingly

Jaybee- commented 12 years ago

I have implemented this already - pull request as soon as I've merged your latest changes.

Jaybee- commented 12 years ago

I would like to suggest the following solution:

  1. All code using this library modified to treat a question type that it doesn't recognise, the same as type: list.
  2. A new type be added, "firmware"
  3. In family_data.json, in the model list for any given model, an optional "firmwareglob" attribute, which, if it exists, contains the glob (e.g. "snom300*.bin") of the firmware.
  4. An applications using the provisioner, when faced with a type: firmware may, at their option:
    • treat this field as an "input" field, allowing the user to type in an arbitrary string, OR
    • build up a list of files in the "firmwares" directory (details/location of which is up to to the application) which match the specified glob, add a "(none)" (or an application-chosen alternative) at the START of this list (and represented by an empty string); default to the item as specified by the input field's "default_value" (which will almost certainly be "").

Note that, without #1, #2 may break some applications, so may need to be delayed until we can get confirmation from other application developers. The change in #1 is trivial. Change #3 will not break existing applications, so may be implemented immediately.

Change #1 also allows future-proofing of this library, to add other input types, e.g. "type: timezone", or "input: password"; in each case older applications will fall back to "input" types.

tm1000 commented 12 years ago

All of those options won't hurt FreePBX or Whistle because we ignore options we don't know. So you can proceed.

Jaybee- commented 12 years ago

replace "glob" with "regex", I think. And warn people that the regex may be /some/path/file.*.bin