# auto\_modules\_\<MODULE\_NAME\> label?

**URL:** <https://discourse.openondemand.org/t/auto-modules-module-name-label/3054>\
**Category:** Get Help\
**Created:** [October 26, 2023, 11:44pm UTC](https://discourse.openondemand.org/t/auto-modules-module-name-label/3054 "2023-10-26T23:44:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![kilian](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/kilian/32/61_2.png) [@kilian](https://discourse.openondemand.org/u/kilian)\
**Post date:** [October 26, 2023, 11:44pm UTC](https://discourse.openondemand.org/t/auto-modules-module-name-label/3054/1 "2023-10-26T23:44:17Z")

</div>

Hi!

I’m trying to update our interactive applications to take advantage of the new [automatic form options](https://osc.github.io/ood-documentation/latest/release-notes/v3.0-release-notes.html#automatic-form-options), especially `auto_modules` and I have a couple questions:

First, it took me quite a while to realize that the JSON module list that [`module_file_dir`](https://osc.github.io/ood-documentation/latest/reference/files/ondemand-d-ymls.html#configuration-properties) points to needed to be named after the cluster name defined in `config/clusters.d`. Retrospectively, it makes sense, but maybe a note in the documentation, for the `module_file_dir` configuration property, would be helpful and save time for other users? 🙂

Then, I’m not really sure how to customize the widget label for `auto_modules`. I have this in my `form.yml`:

```auto
form:
  - auto_modules_python

attributes:
  auto_modules_python
    label: "custom label for Python"

```

but the app form shows the label as “Auto modules (none given)”, instead of my custom label. Is it expected?

Thanks!

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [October 27, 2023, 1:42pm UTC](https://discourse.openondemand.org/t/auto-modules-module-name-label/3054/2 "2023-10-27T13:42:38Z")

</div>

Thanks for the feedback - I’ll make a ticket for the same directly.

I do know that they’re case sensitive - so `python` is different than `Python` (another thing that needs documented!). That’s what I would guess off the top (I had this issue with our R modules).

---

<div class="post-metadata">

**Author:** ![kilian](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/kilian/32/61_2.png) [@kilian](https://discourse.openondemand.org/u/kilian)\
**Post date:** [October 27, 2023, 2:55pm UTC](https://discourse.openondemand.org/t/auto-modules-module-name-label/3054/3 "2023-10-27T14:55:01Z")

</div>

Thanks @jeff.ohrstrom !

For the label question, it doesn’t seem related to capitalization, our `python` modules are all lower case.

To clarify, using the example configuration in my first post, `auto_modules_python` works and correctly display a widget with the list of our Python module versions. It’s just the widget label that defaults to ‘Auto modules (none given)’ instead of using the `label` attribute from the `form.yml` file:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/3/37a30df5a430b1879f829f07e77dcfedbd47408b.png)

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [October 27, 2023, 3:27pm UTC](https://discourse.openondemand.org/t/auto-modules-module-name-label/3054/4 "2023-10-27T15:27:06Z")

</div>

Sorry! Yea I think you just found a bug.

What we have is here:

> <https://github.com/OSC/ondemand/blob/d84bdbcd4ae3c4e2743604dd396c7664a6abf49b/apps/dashboard/app/lib/smart_attributes/attributes/auto_modules.rb#L30C102-L30C102>

It should actually have `()` around the 2nd operand. You can edit your production file if you like. I’ll submit a patch shortly but since we’re close to 3.1 I don’t know if there’ll be a 3.0.4 (unless there are more bugs!)

```ruby
 @opts[:label] || (@hpc_module.nil? ? 'Auto modules (none given)' : "#{@hpc_module.titleize} version")

```

---

<div class="post-metadata">

**Author:** ![kilian](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/kilian/32/61_2.png) [@kilian](https://discourse.openondemand.org/u/kilian)\
**Post date:** [October 27, 2023, 3:38pm UTC](https://discourse.openondemand.org/t/auto-modules-module-name-label/3054/5 "2023-10-27T15:38:52Z")

</div>

Ah right, that makes sense.  
Thanks for confirming the issue and providing a quick fix, much appreciated!

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [October 27, 2023, 4:11pm UTC](https://discourse.openondemand.org/t/auto-modules-module-name-label/3054/6 "2023-10-27T16:11:15Z")

</div>

I have a pull request in to fix it that I’ll backport to 3.0. Though, that said - it’ll take a few more bugs/patches for us to release `3.0.4`, so I don’t know if the patch will make it’s way to you until 3.1 or what.

---

<div class="post-metadata">

**Author:** ![kilian](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/kilian/32/61_2.png) [@kilian](https://discourse.openondemand.org/u/kilian)\
**Post date:** [October 28, 2023, 12:30am UTC](https://discourse.openondemand.org/t/auto-modules-module-name-label/3054/7 "2023-10-28T00:30:28Z")

</div>

I have another feature/enhancement suggestion, not too sure how it’s achievable, but at the moment, when the list of available module versions includes “default”, there’s no way to tell which version if the default one. Maybe adding a little indicator next to the default version number, or the explicit version number next to the “default” label could be helpful?

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [October 30, 2023, 1:22pm UTC](https://discourse.openondemand.org/t/auto-modules-module-name-label/3054/8 "2023-10-30T13:22:29Z")

</div>

Yea I can file the ticket. I’ll have to check lmod spider output to see if it actually indicates what version is default though (I’m not 100% sure if it does).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/bae70bd0ed39a3ae769c2108155f4cb3e9da8385.png) [@system](https://discourse.openondemand.org/u/system)\
**Post date:** [April 27, 2024, 1:22pm UTC](https://discourse.openondemand.org/t/auto-modules-module-name-label/3054/9 "2024-04-27T13:22:52Z")

</div>

Closed on April 27, 2024, 1:22pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
