1. Min Length of Slice Name Differs

Min Length of Slice Name Differs

Home Forums FABRIC General Questions and Discussion Min Length of Slice Name Differs

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3302
    Charles Carpenter
    Participant

      I found that I can create a slice with a 2 letter name, but I cannot get the slice using a 2 letter name.

      from fabrictestbed_extensions.fablib.fablib import fablib
      slices = fablib.get_slices()
      for slice in slices:
      print(slice)
      ———– ————————————
      Slice Name t2
      Slice ID dd808d37-fd1c-4cf0-bc35-9e4028f5df8d
      Slice State StableOK
      Lease End 2022-10-12 16:32:11 +0000
      ———– ————————————

       

      fablib.get_slice(“t2”)
      —————————————————————————
      Exception Traceback (most recent call last)
      /tmp/ipykernel_1146/763813930.py in <module>
      —-> 1 fablib.get_slice(“t2”)

      ~/.local/lib/python3.9/site-packages/fabrictestbed_extensions/fablib/fablib.py in get_slice(name, slice_id)
      416 :rtype: Slice
      417 “””
      –> 418 return fablib.get_default_fablib_manager().get_slice(name=name, slice_id=slice_id)
      419
      420 @staticmethod

      ~/.local/lib/python3.9/site-packages/fabrictestbed_extensions/fablib/fablib.py in get_slice(self, name, slice_id)
      1206 elif name:
      1207 # if getting by name then only consider active slices
      -> 1208 slices = self.get_slices(excludes=[SliceState.Dead, SliceState.Closing], slice_name=name)
      1209
      1210 return slices[0]

      ~/.local/lib/python3.9/site-packages/fabrictestbed_extensions/fablib/fablib.py in get_slices(self, excludes, slice_name, slice_id)
      1175 return_slices.append(Slice.get_slice(self, sm_slice=slice))
      1176 else:
      -> 1177 raise Exception(f”Failed to get slices: {slices}”)
      1178 return return_slices
      1179

      Exception: Failed to get slices: (400)
      Reason: BAD REQUEST
      HTTP response headers: HTTPHeaderDict({‘Server’: ‘nginx/1.21.6’, ‘Date’: ‘Wed, 12 Oct 2022 15:03:36 GMT’, ‘Content-Type’: ‘application/problem+json’, ‘Content-Length’: ‘214’, ‘Connection’: ‘keep-alive’})
      HTTP response body: b'{\n “detail”: “\’t2\’ is too short\\n\\nFailed validating \’minLength\’ in schema:\\n {\’minLength\’: 3, \’type\’: \’string\’}\\n\\nOn instance:\\n \’t2\'”,\n “status”: 400,\n “title”: “Bad Request”,\n “type”: “about:blank”\n}\n’

      #3303
      Komal Thareja
      Participant

        Thank you Charles for reporting this issue. It’s a bug in the code. We will fix it.

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.
      FABRIC invites nominations for four awards recognizing innovative uses of FABRIC resources—Best Published Paper, Best FABRIC Matrix, Best FABRIC Experiment, and Best Classroom Use of FABRIC — submissions due by **Monday, February 24 at 11:59 PM ET**, and winners announced at KNIT10. [>>>Submit Form](https://docs.google.com/forms/d/e/1FAIpQLSeTp3i2iDhB7bHgN8ryMxZci8ya87yjeQd7_JMZImUodNinVA/viewform)

      KNIT10 Call for Demos Now Open! Submit your demo by **February 24**. [>>>Submit Demo](https://docs.google.com/forms/d/e/1FAIpQLScRIWqHliNP3DFWBCnalYN_fBXJXVM0PpP9YWWJdSebC95TvA/viewform)
      FABRIC invites nominations for four awards recognizing innovative uses of FABRIC resources—Best Published Paper, Best FABRIC Matrix, Best FABRIC Experiment, and Best Classroom Use of FABRIC — submissions due by **Monday, February 24 at 11:59 PM ET**, and winners announced at KNIT10. [>>>Submit Form](https://docs.google.com/forms/d/e/1FAIpQLSeTp3i2iDhB7bHgN8ryMxZci8ya87yjeQd7_JMZImUodNinVA/viewform)

      KNIT10 Call for Demos Now Open! Submit your demo by **February 24**. [>>>Submit Demo](https://docs.google.com/forms/d/e/1FAIpQLScRIWqHliNP3DFWBCnalYN_fBXJXVM0PpP9YWWJdSebC95TvA/viewform)