Skip to content

Error in validating the path for custom_template field while creating the Event channel #71

@sachin-apa

Description

@sachin-apa

While creating a event channel, when a path is specified for custom template field it fails with an error as regex is not matching.

Run the script with a below code where custom_template field is given an input as "/ifs/data"

parameters = isilon_sdk.v9_5_0.EventChannelParameters(
    address="my.email.com",
    custom_template="/ifs/data"
)

event_channel = isilon_sdk.v9_5_0.EventChannelCreateParams(
    enabled=enabled,
    name=name,
    type=type,
    allowed_nodes=allowed_nodes,
    excluded_nodes=excluded_nodes,
    parameters=parameters
)

try:
      api_response = api_instance.create_event_channel(event_channel)
      pprint(api_response)
except ApiException as e:
      print("Exception when calling EventApi->create_event_channel: %s\n" % e)

Actual
Fails with an error as below

Traceback (most recent call last):
  File "/home/sachin/collections/tryout/powerscale_scripts/event_channel.py", line 159, in <module>
    parameters = isilon_sdk.v9_5_0.EventChannelParameters(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sachin/.local/lib/python3.11/site-packages/isilon_sdk/v9_5_0/models/event_channel_parameters.py", line 87, in __init__
    self.custom_template = custom_template
    ^^^^^^^^^^^^^^^^^^^^
  File "/home/sachin/.local/lib/python3.11/site-packages/isilon_sdk/v9_5_0/models/event_channel_parameters.py", line 209, in custom_template
    raise ValueError("Invalid value for `custom_template`, must be a follow pattern or equal to `/^((\/[^\/[:cntrl:]]+)(\/?))*$/`")  # noqa: E501
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Invalid value for `custom_template`, must be a follow pattern or equal to `/^((\/[^\/[:cntrl:]]+)(\/?))*$/`

Expected

Create event channel as the input "/ifs/data/" is a correct input for the field "custom_template".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions