Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make some Info and NodeInfo attributes optional #7

Closed
nickjer opened this issue Mar 31, 2017 · 0 comments
Closed

Make some Info and NodeInfo attributes optional #7

nickjer opened this issue Mar 31, 2017 · 0 comments
Assignees

Comments

@nickjer
Copy link
Contributor

nickjer commented Mar 31, 2017

Make some Info and NodeInfo attributes optional. For example:

job_info.cpu_time
# => nil

Some of these attributes (in particular Info#submit_host, Info#cpu_time, and NodeInfo#procs for Slurm) can not be retrieved for a given resource manager. Setting them nil will make them easy to check for existence and let the app display a default value if it wants.

For example:

<li class="job-info">
  <%= content_tag :ul, "Job Id = #{info.job_id}" %>
  <%# Don't display list item if it doesn't exist %>
  <%= content_tag :ul, "Submit Host = #{info.submit_host}" if info.submit_host %>
  <%# Set a default value for list item if it doesn't exist %>
  <%= content_tag :ul, "CPU Time = #{info.cpu_time || "Not Supported"}" %>
</li>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants