# Quotes in submit.yml.erb field

**URL:** <https://discourse.openondemand.org/t/quotes-in-submit-yml-erb-field/2565>\
**Category:** Get Help\
**Created:** [March 27, 2023, 5:41pm UTC](https://discourse.openondemand.org/t/quotes-in-submit-yml-erb-field/2565 "2023-03-27T17:41:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcuma](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/mcuma/32/171_2.png) [@mcuma](https://discourse.openondemand.org/u/mcuma)\
**Post date:** [March 27, 2023, 5:41pm UTC](https://discourse.openondemand.org/t/quotes-in-submit-yml-erb-field/2565/1 "2023-03-27T17:41:56Z")

</div>

Hi everyone,

I have another Ruby tricky question. I want to implement adding SLURM constraints to the job submission parameters. So, I create a `constraints` entry box in form.yml, and in `submit.yml.erb` do

```auto
script:
  native:
    <%- if constraint != "" -%>
    - "-C"
    - "<%= constraint %>"
    <%- end -%>

```

That all works great for a single constraint, but, to combine more than one constraint, it needs to be quoted. For example, to ask for both AMD CPU kinds that we have, the SLURM option is `-C "rom|mil"`.

I am struggling with adding those quotes OOD’s generated list of SLURM options. The above in `submit.yml.erb` generates the following in the `job_script_options.json`:

```auto
native:
0: "-C"
1: "rom|mil"

```

which gets passed to the `sbatch` without quotes, that is as `sbatch -C rom|mil`, which SLURM does not like.

Anyone knows how to add quotes to this? I tried things like escaping, or double quotes, but no luck so far.

Thanks,  
Martin

---

<div class="post-metadata">

**Author:** ![mcuma](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/mcuma/32/171_2.png) [@mcuma](https://discourse.openondemand.org/u/mcuma)\
**Post date:** [March 28, 2023, 7:54pm UTC](https://discourse.openondemand.org/t/quotes-in-submit-yml-erb-field/2565/2 "2023-03-28T19:54:52Z")

</div>

I’ll answer this myself. I must have had a typo in the constraint, as after some wrangling with it, it started working without making any changes to the `submit.yml.erb`. So, it looks like OOD is doing things right and quoting stuff correctly.

---

<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:** [September 24, 2023, 7:55pm UTC](https://discourse.openondemand.org/t/quotes-in-submit-yml-erb-field/2565/3 "2023-09-24T19:55:52Z")

</div>

Closed on September 24, 2023, 7:55pm UTC

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