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

slice.show() can crash #195

Open
sajith opened this issue Jul 14, 2023 · 0 comments
Open

slice.show() can crash #195

sajith opened this issue Jul 14, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@sajith
Copy link
Member

sajith commented Jul 14, 2023

If we try to show() a slice before submit(), we crash. Consider the below snippet:

from fabrictestbed_extensions.fablib.fablib import FablibManager

fm = FablibManager()
slice = fm.new_slice(name="test-slice")
slice.show()

This fails with:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "./fabrictestbed_extensions/fablib/slice.py", line 168, in show
    data = self.toDict()
           ^^^^^^^^^^^^^
  File "./fabrictestbed_extensions/fablib/slice.py", line 486, in toDict
    "project_id": str(self.get_project_id()),
                      ^^^^^^^^^^^^^^^^^^^^^
  File "./fabrictestbed_extensions/fablib/slice.py", line 842, in get_project_id
    return self.sm_slice.project_id
           ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'project_id'

Perhaps this could fail a little more gracefully.

@sajith sajith added the bug Something isn't working label Jul 14, 2023
@sajith sajith self-assigned this Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant