bumps version to 1.8.1

This commit is contained in:
Ricardo Bartels
2026-03-18 21:17:34 +01:00
parent 49e0688efa
commit e972c94eac
36 changed files with 48 additions and 46 deletions
+3 -3
View File
@@ -99,18 +99,18 @@ usage: netbox-sync.py [-h] [-c settings.ini [settings.ini ...]] [-g]
Sync objects from various sources to NetBox
Version: 1.8.0 (2025-03-07)
Version: 1.8.1 (2026-03-18)
Project URL: https://github.com/bb-ricardo/netbox-sync
options:
-h, --help show this help message and exit
-c settings.ini [settings.ini ...], --config settings.ini [settings.ini ...]
-c, --config settings.ini [settings.ini ...]
points to the config file to read config data from
which is not installed under the default path
'./settings.ini'
-g, --generate_config
generates default config file.
-l {DEBUG3,DEBUG2,DEBUG,INFO,WARNING,ERROR}, --log_level {DEBUG3,DEBUG2,DEBUG,INFO,WARNING,ERROR}
-l, --log_level {DEBUG3,DEBUG2,DEBUG,INFO,WARNING,ERROR}
set log level (overrides config)
-n, --dry_run Operate as usual but don't change anything in NetBox.
Great if you want to test and see what would be
+3 -3
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
@@ -7,8 +7,8 @@
# For a copy, see file LICENSE.txt included in this
# repository or visit: <https://opensource.org/licenses/MIT>.
__version__ = "1.8.0"
__version_date__ = "2025-03-07"
__version__ = "1.8.1"
__version_date__ = "2026-03-18"
__author__ = "Ricardo Bartels <ricardo.bartels@telekom.de>"
__description__ = "NetBox Sync"
__license__ = "MIT"
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+5 -5
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
@@ -683,7 +683,7 @@ class NetBoxObject:
if self.data_model.get(key) == NBCustomField:
if current_value is None:
current_value = dict()
# Fix for object/multi-object custom fields
# When patching, we only need the IDs, not the full object representation
new_value_copy = new_value.copy()
@@ -692,11 +692,11 @@ class NetBoxObject:
custom_field = self.inventory.get_by_data(NBCustomField, data={"name": field_name})
if custom_field is not None:
field_type = grab(custom_field, "data.type")
# Handle object type custom fields - need only ID
if field_type == "object" and isinstance(field_value, dict) and field_value.get('id') is not None:
new_value[field_name] = field_value.get('id')
# Handle multi-object type custom fields - need list of IDs
elif field_type == "multi-object" and isinstance(field_value, list):
ids = []
@@ -705,7 +705,7 @@ class NetBoxObject:
ids.append(item.get('id'))
if ids:
new_value[field_name] = ids
new_value = {**current_value, **new_value}
new_value_str = str(new_value)
elif isinstance(new_value, (NetBoxObject, NBObjectList)):
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "netbox-sync"
version = "1.8.0"
version = "1.8.1"
description = "Sync objects from various sources to NetBox"
authors = [
{ name = "Ricardo Bartels", email = "ricardo.bartels@telekom.de" }
+1 -1
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
+5 -3
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
@@ -11,8 +11,9 @@
EXAMPLE_CONFIG_FILE="settings-example.ini"
VERSION_DATA_FILE="module/__init__.py"
README_FILE="README.md"
PYPROJECT_TOML="pyproject.toml"
VERSION_TO_SET="$1"
COPYRIGHT_PATTERN="# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved."
COPYRIGHT_PATTERN="# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved."
BASE_PATH="$(realpath "$(dirname "${0}")/..")"
# shellcheck disable=SC2181
@@ -28,6 +29,7 @@ read -rp "Should '$VERSION_TO_SET' be set as the new version [yN]: " -n1 ANSWER
# setting new version and date
sed -i "" -e 's/^__version__.*/__version__ = "'"${VERSION_TO_SET}"'"/g' "${VERSION_DATA_FILE}"
sed -i "" -e 's/^__version_date__.*/__version_date__ = "'"$(date +%F)"'"/g' "${VERSION_DATA_FILE}"
sed -i "" -e 's/^version = .*/version = "'"${VERSION_TO_SET}"'"/g' ${PYPROJECT_TOML}
# update config
[[ -e "${EXAMPLE_CONFIG_FILE}" ]] && rm "$EXAMPLE_CONFIG_FILE"
@@ -46,7 +48,7 @@ README_BOTTOM=$(sed -n '/## TESTING/,$ p' "${README_FILE}")
} > "${README_FILE}"
# update COPYRIGHT notice date
NEW_COPYRIGHT_NOTICE="${COPYRIGHT_PATTERN//..../$(date +%Y)}"
NEW_COPYRIGHT_NOTICE="${COPYRIGHT_PATTERN//2020 - $(($(date +%Y)-1))/2020 - $(date +%Y)}"
grep -lR "$COPYRIGHT_PATTERN" "${BASE_PATH}" | while read -r FILE; do
sed -i "" -e 's/'"${COPYRIGHT_PATTERN}"'/'"${NEW_COPYRIGHT_NOTICE}"'/g' "${FILE}"
done
+1 -1
View File
@@ -1,5 +1,5 @@
;;; Welcome to the NetBox Sync configuration file.
;;; Version: 1.8.0 (2025-03-07)
;;; Version: 1.8.1 (2026-03-18)
;;; Project URL: https://github.com/bb-ricardo/netbox-sync
; The values in this file override the default values used by the system if a config