1. Bug / footgun calling slice.delete()

Bug / footgun calling slice.delete()

Home Forums FABRIC General Questions and Discussion Bug / footgun calling slice.delete()

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #7089
    Sunjay Cauligi
    Participant

      If you call slice.delete() on a slice that hasn’t been submitted yet, then fablib deletes all of your slices.

      Discovered due to seemingly-benign code I was running like so:

      try:
        slice = fablib.new_slice(name="test")
        # ... add nodes/networks to slice ...
        slice.submit()
      except:
        slice.delete()

      It seems to be because the slice object’s .sm_slice field is set to None, which is treated by one of the underlying APIs as denoting “delete all” instead of “unknown slice”.

      #7092
      Komal Thareja
      Participant

        Thank you for sharing this Sunjay, we will fix this in the next version.

        Thanks,

        Komal

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.