fabric-testbed / InformationModel

FABRIC Information Model library
MIT License
7 stars 1 forks source link

Interface Sliver name regex update to allow interface names with 1 character #198

Closed kthare10 closed 9 months ago

kthare10 commented 9 months ago

Error report from Hussam: I am working with gauravdeep at CIEN to get generate an ARM for their rack. They are using ciena network equipment which represents the network ports in a different format. This currently breaks the fim_utils used for generating the ads. The ports on the CIENA switch are called 2/2 and 2/1 in one case and two others that just integers 5 and 6. I think Ilya had configured the fim_utils to look for Hundredgig 0/0/0/5. Even if i modify fim_utils to work in the CIENA format, will this break anything in the AM/CF side ?

(fim-utils) nasir@dlat4770:~/FABRIC/aggregate-ads$ ~/scan.sh CIEN '385 Terry Fox Drive, Ottawa, Ontario, Canada'
Validating site postal address 385 Terry Fox Drive, Ottawa, Ontario, Canada
lat=45.3452183, lon=-75.9285759977324
INFO:root:Using static configuration file /home/nasir/FABRIC/aggregate-ads/config/.scan-config.json
WARNING:root:Disabling server SSL certificate validation
INFO:root:Cataloging site CIEN
INFO:root:Searching for DP switch URL
INFO:root:Identified DP switch dp_switch_url='http://inventory.dcr.renc.fabric/api/data-center-assets/1214/'
INFO:root:Overriding CIEN PTP setting with True from static configuration file
INFO:root:Identified 2 workers
INFO:root:Parsing worker='http://inventory.dcr.renc.fabric/api/data-center-assets/1217/'
INFO:root:Parsing worker='http://inventory.dcr.renc.fabric/api/data-center-assets/1219/'
INFO:root:Identified storage storage_url='http://inventory.dcr.renc.fabric/api/data-center-assets/1215/'
INFO:root:Cataloging complete
INFO:root:Producing an ARM model
INFO:root:Producing SubstrateTopology model for site CIEN
INFO:root:Adding DP switch ('cien-data-sw', 'node+cien-data-sw:ip+192.168.46.3')
Traceback (most recent call last):
  File "/home/nasir/.virtualenvs/fim-utils/bin/scan_site", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/nasir/.virtualenvs/fim-utils/lib/python3.11/site-packages/fimutil/utilities/scan_site.py", line 120, in main
    topo = site_to_fim(site, args.address, config)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nasir/.virtualenvs/fim-utils/lib/python3.11/site-packages/fimutil/ralph/fim_helper.py", line 490, in site_to_fim
    sp = dp_ns.add_interface(name=k,
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nasir/.virtualenvs/fim-utils/lib/python3.11/site-packages/fim/user/network_service.py", line 380, in add_interface
    iff = Interface(name=name, node_id=node_id, parent_node_id=self.node_id,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nasir/.virtualenvs/fim-utils/lib/python3.11/site-packages/fim/user/interface.py", line 75, in __init__
    sliver.set_name(self.name)
  File "/home/nasir/.virtualenvs/fim-utils/lib/python3.11/site-packages/fim/slivers/base_sliver.py", line 81, in set_name
    raise ValueError(f"Sliver name {resource_name} doesn't match the expected "
ValueError: Sliver name 5 doesn't match the expected regular expression ^[\w\-+_/\.\ :]{2,255}$