Skip to content

Commit b5286cb

Browse files
committed
Merge branch 'externals' into 'main'
Fix for CodeQL report See merge request 701/netbox/cesnet_service_path_plugin!35
2 parents 66415ab + 58fc7f4 commit b5286cb

File tree

4 files changed

+54
-14
lines changed

4 files changed

+54
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A NetBox plugin for managing service paths and segments in network infrastructur
55
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
66
[![PyPI version](https://img.shields.io/pypi/v/cesnet-service-path-plugin.svg)](https://pypi.org/project/cesnet-service-path-plugin/)
77
[![Python versions](https://img.shields.io/pypi/pyversions/cesnet-service-path-plugin.svg)](https://pypi.org/project/cesnet-service-path-plugin/)
8-
[![NetBox compatibility](https://img.shields.io/badge/NetBox-4.2%20|%204.3%20|%204.4-blue.svg)](https://github.com/netbox-community/netbox)
8+
[![NetBox compatibility](https://img.shields.io/badge/NetBox-4.4-blue.svg)](https://github.com/netbox-community/netbox)
99

1010
## 📑 Table of Contents
1111

cesnet_service_path_plugin/api/serializers/segment.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import logging
23
from circuits.api.serializers import CircuitSerializer, ProviderSerializer
34
from dcim.api.serializers import (
45
LocationSerializer,
@@ -14,6 +15,9 @@
1415
from django.core.exceptions import ValidationError as DjangoValidationError
1516

1617

18+
logger = logging.getLogger(__name__)
19+
20+
1721
class SegmentSerializer(NetBoxModelSerializer):
1822
"""Default serializer Segment - now with file upload support"""
1923

@@ -100,9 +104,11 @@ def update(self, instance, validated_data):
100104
instance.save()
101105

102106
except DjangoValidationError as e:
103-
raise serializers.ValidationError(f"Path file error: {str(e)}")
107+
logger.warning(f"Validation Path file error: {str(e)}")
108+
raise serializers.ValidationError(f"Error processing file '{path_file.name}'")
104109
except Exception as e:
105-
raise serializers.ValidationError(f"Error processing file '{path_file.name}': {str(e)}")
110+
logger.error(f"Error processing file '{path_file.name}': {str(e)}")
111+
raise serializers.ValidationError(f"Error processing file '{path_file.name}'")
106112

107113
return instance
108114

@@ -129,11 +135,13 @@ def create(self, validated_data):
129135
except DjangoValidationError as e:
130136
# Clean up created instance if path processing fails
131137
instance.delete()
132-
raise serializers.ValidationError(f"Path file error: {str(e)}")
138+
logger.warning(f"Validation Path file error: {str(e)}")
139+
raise serializers.ValidationError(f"Error processing file '{path_file.name}'")
133140
except Exception as e:
134141
# Clean up created instance if path processing fails
135142
instance.delete()
136-
raise serializers.ValidationError(f"Error processing file '{path_file.name}': {str(e)}")
143+
logger.error(f"Error processing file '{path_file.name}': {str(e)}")
144+
raise serializers.ValidationError(f"Error processing file '{path_file.name}'")
137145

138146
return instance
139147

netbox-plugin.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
version: 0.1
2+
package_name: cesnet-service-path-plugin
3+
compatibility:
4+
- release: 5.1.2
5+
netbox_min: 4.4.0
6+
netbox_max: 4.4.99
7+
- release: 5.1.1
8+
netbox_min: 4.4.0
9+
netbox_max: 4.4.99
10+
- release: 5.1.0
11+
netbox_min: 4.4.0
12+
netbox_max: 4.4.99
13+
- release: 5.0.3
14+
netbox_min: 4.3.0
15+
netbox_max: 4.3.99
16+
- release: 5.0.2
17+
netbox_min: 4.3.0
18+
netbox_max: 4.3.99
19+
- release: 5.0.1
20+
netbox_min: 4.3.0
21+
netbox_max: 4.3.99
22+
- release: 5.0.0
23+
netbox_min: 4.3.0
24+
netbox_max: 4.3.99
25+
- release: 4.0.1
26+
netbox_min: 4.2.0
27+
netbox_max: 4.2.99
28+
- release: 4.0.0
29+
netbox_min: 4.2.0
30+
netbox_max: 4.2.99
31+
- release: 0.1.0
32+
netbox_min: 3.7.0
33+
netbox_max: 3.7.99

pyproject.toml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "cesnet_service_path_plugin"
7-
version = "5.1.2"
7+
version = "5.1.3"
88
description = "Adds ability to create, edit and view service paths in the CESNET network."
99
authors = [
1010
{name = "Jan Krupa", email = "[email protected]"},
1111
{name = "Jiri Vrany", email = "[email protected]"}
1212
]
1313
license = {text = "Apache-2.0"}
1414
readme = "README.md"
15-
requires-python = ">=3.8"
15+
requires-python = ">=3.10"
1616
dependencies = [
1717
"geopandas",
1818
"fiona",
@@ -21,11 +21,10 @@ dependencies = [
2121
classifiers = [
2222
"Development Status :: 4 - Beta",
2323
"Intended Audience :: Developers",
24-
"License :: OSI Approved :: MIT License",
24+
"Framework :: Django",
25+
"License :: OSI Approved :: Apache Software License",
2526
"Operating System :: OS Independent",
26-
"Programming Language :: Python :: 3",
27-
"Programming Language :: Python :: 3.8",
28-
"Programming Language :: Python :: 3.9",
27+
"Programming Language :: Python :: 3 :: Only",
2928
"Programming Language :: Python :: 3.10",
3029
"Programming Language :: Python :: 3.11",
3130
"Programming Language :: Python :: 3.12",
@@ -38,10 +37,10 @@ Issues = "https://github.com/CESNET/cesnet_service_path_plugin/issues"
3837

3938
[project.optional-dependencies]
4039
dev = [
41-
"black==24.3.0",
40+
"black",
4241
"autopep8",
43-
"pip==24.0",
44-
"check-manifest==0.49",
42+
"pip",
43+
"check-manifest",
4544
]
4645

4746
[tool.setuptools.packages.find]

0 commit comments

Comments
 (0)