proxsync 2.0.4__tar.gz → 2.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {proxsync-2.0.4/proxsync.egg-info → proxsync-2.0.5}/PKG-INFO +1 -1
- {proxsync-2.0.4 → proxsync-2.0.5/proxsync.egg-info}/PKG-INFO +1 -1
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync.py +12 -7
- {proxsync-2.0.4 → proxsync-2.0.5}/pyproject.toml +1 -1
- {proxsync-2.0.4 → proxsync-2.0.5}/state_db.py +2 -2
- {proxsync-2.0.4 → proxsync-2.0.5}/MANIFEST.in +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/README.md +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/config.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pbs_sync.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/proxsync.egg-info/SOURCES.txt +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/proxsync.egg-info/dependency_links.txt +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/proxsync.egg-info/requires.txt +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/proxsync.egg-info/top_level.txt +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/__init__.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/api/__init__.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/api/serializers.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/api/urls.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/api/views.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/apps.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/choices.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/filtersets.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/forms.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/management/__init__.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/management/commands/__init__.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/management/commands/pve_sync.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/management/commands/run_scheduled_syncs.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0001_initial.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0002_pvepluginsettings.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0003_netboxmodel_timestamps.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0004_model_verbose_names.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0005_align_netboxmodel_timestamps.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0006_pbsserverconfig_and_more.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0007_rename_verbose_names_to_proxmox_sync.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0008_pbsserverconfig_sync_schedule.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0009_add_every_3h_schedule.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0010_pvedriftevent.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0011_pveclusterconfig_notify_on_sync.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0012_pvedriftevent_tags_and_index_renames.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0013_pluginsettings_log_retention.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0014_vmprovisioninglog.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0015_pvevmtasklog.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0016_pvevmtasklog_status_textfield.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/__init__.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/models.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/navigation.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/signals.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/sync/__init__.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/sync/config_bridge.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/sync/engine.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/tables.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/tasks.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/template_content.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/templates/pve_sync/dashboard.html +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/templates/pve_sync/inc/vm_sync_button.html +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/templates/pve_sync/inc/vm_task_log_panel.html +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/templates/pve_sync/pbsserverconfig.html +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/templates/pve_sync/pvebackupstatus.html +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/templates/pve_sync/pveclusterconfig.html +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/templates/pve_sync/pvedriftevent.html +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/templates/pve_sync/pvesyncjob.html +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/templates/pve_sync/pvevmtasklog_list.html +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/templates/pve_sync/pvewebhookevent.html +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/templates/pve_sync/settings.html +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/templates/pve_sync/vm_provisioning_combined.html +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/templates/pve_sync/vm_provisioning_log.html +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/templatetags/__init__.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/templatetags/pve_sync_tags.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/urls.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/utils.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/view_helpers.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/views.py +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/setup.cfg +0 -0
- {proxsync-2.0.4 → proxsync-2.0.5}/tests/test_plugin_contracts.py +0 -0
|
@@ -1084,6 +1084,11 @@ class OptimizedPVEToNetBoxSync:
|
|
|
1084
1084
|
disks[key] = m.group(1) if m else val_str[:80]
|
|
1085
1085
|
return disks
|
|
1086
1086
|
|
|
1087
|
+
@staticmethod
|
|
1088
|
+
def _norm_desc(s) -> str:
|
|
1089
|
+
"""Normalize description: unify line endings, strip whitespace."""
|
|
1090
|
+
return (s or '').replace('\r\n', '\n').replace('\r', '\n').strip()
|
|
1091
|
+
|
|
1087
1092
|
def _write_drift_event(self, vm_name: str, vmid: int, drift_type: str,
|
|
1088
1093
|
field_name: str, old_value: str, new_value: str,
|
|
1089
1094
|
notified: bool = False):
|
|
@@ -1461,8 +1466,8 @@ class OptimizedPVEToNetBoxSync:
|
|
|
1461
1466
|
self._write_drift_event(vm_name, vm_id, 'disk_change', k, old_v, new_v, notified=True)
|
|
1462
1467
|
|
|
1463
1468
|
# VM 描述變更偵測
|
|
1464
|
-
current_desc = (vm_config.get('description')
|
|
1465
|
-
old_desc = (last_config.get('description')
|
|
1469
|
+
current_desc = self._norm_desc(vm_config.get('description'))[:500]
|
|
1470
|
+
old_desc = self._norm_desc(last_config.get('description'))
|
|
1466
1471
|
if old_desc and old_desc != current_desc:
|
|
1467
1472
|
self.stats['config_drifts_detected'] += 1
|
|
1468
1473
|
print(f"📝 VM {vm_name} 描述變更")
|
|
@@ -1749,7 +1754,7 @@ class OptimizedPVEToNetBoxSync:
|
|
|
1749
1754
|
vm_id=int(vm_id), cluster_name=self.cluster_name, config_hash=config_hash,
|
|
1750
1755
|
memory=memory, vcpus=vcpus_save, tags=tag_names,
|
|
1751
1756
|
node=node_name, primary_ip=cur_ip, vm_name=original_vm_name,
|
|
1752
|
-
description=(vm_config.get('description')
|
|
1757
|
+
description=self._norm_desc(vm_config.get('description'))[:500],
|
|
1753
1758
|
disk_summary=json.dumps(self._parse_disk_summary(vm_config)),
|
|
1754
1759
|
)
|
|
1755
1760
|
except Exception as _snap_err:
|
|
@@ -1806,7 +1811,7 @@ class OptimizedPVEToNetBoxSync:
|
|
|
1806
1811
|
update_data = {
|
|
1807
1812
|
'name': vm_name, 'cluster': cluster['id'], 'device': device.id, 'role': role_id,
|
|
1808
1813
|
'vcpus': vcpus, 'memory': int(vm_config.get('memory', 0)), 'status': status,
|
|
1809
|
-
'description': (vm_config.get('description')
|
|
1814
|
+
'description': self._norm_desc(vm_config.get('description'))[:200], 'platform': platform_id,
|
|
1810
1815
|
'start_on_boot': boot_choice
|
|
1811
1816
|
}
|
|
1812
1817
|
if tag_ids:
|
|
@@ -1825,7 +1830,7 @@ class OptimizedPVEToNetBoxSync:
|
|
|
1825
1830
|
vm_data_dict = {
|
|
1826
1831
|
'serial': vm_id, 'name': vm_name, 'cluster': cluster['id'], 'device': device.id,
|
|
1827
1832
|
'role': role_id, 'vcpus': vcpus, 'memory': int(vm_config.get('memory', 0)),
|
|
1828
|
-
'status': status, 'description': (vm_config.get('description')
|
|
1833
|
+
'status': status, 'description': self._norm_desc(vm_config.get('description'))[:200],
|
|
1829
1834
|
'platform': platform_id, 'start_on_boot': boot_choice
|
|
1830
1835
|
}
|
|
1831
1836
|
if tag_ids:
|
|
@@ -1862,7 +1867,7 @@ class OptimizedPVEToNetBoxSync:
|
|
|
1862
1867
|
vm_id=int(vm_id), cluster_name=self.cluster_name, config_hash=config_hash,
|
|
1863
1868
|
memory=memory, vcpus=vcpus_save, tags=tag_names,
|
|
1864
1869
|
node=node_name, primary_ip=primary_ip_str, vm_name=original_vm_name,
|
|
1865
|
-
description=(vm_config.get('description')
|
|
1870
|
+
description=self._norm_desc(vm_config.get('description'))[:500],
|
|
1866
1871
|
disk_summary=json.dumps(self._parse_disk_summary(vm_config)),
|
|
1867
1872
|
)
|
|
1868
1873
|
return True
|
|
@@ -1887,7 +1892,7 @@ class OptimizedPVEToNetBoxSync:
|
|
|
1887
1892
|
node=node_name,
|
|
1888
1893
|
primary_ip=_ip,
|
|
1889
1894
|
vm_name=original_vm_name,
|
|
1890
|
-
description=(vm_config.get('description')
|
|
1895
|
+
description=self._norm_desc(vm_config.get('description'))[:500],
|
|
1891
1896
|
disk_summary=json.dumps(self._parse_disk_summary(vm_config)),
|
|
1892
1897
|
)
|
|
1893
1898
|
except Exception:
|
|
@@ -154,7 +154,7 @@ class StateDB:
|
|
|
154
154
|
with sqlite3.connect(self.db_path) as conn:
|
|
155
155
|
conn.execute(
|
|
156
156
|
"""
|
|
157
|
-
INSERT INTO vm_config_history
|
|
157
|
+
INSERT OR REPLACE INTO vm_config_history
|
|
158
158
|
(vm_id, cluster_name, config_hash, memory, vcpus, tags_json,
|
|
159
159
|
node, primary_ip, vm_name, description, disk_summary)
|
|
160
160
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
@@ -507,7 +507,7 @@ def compute_config_hash(vm_config: Dict[str, Any], tags: List[str], network_inte
|
|
|
507
507
|
'ostype': vm_config.get('ostype', ''),
|
|
508
508
|
'cores': vm_config.get('cores', 1),
|
|
509
509
|
'sockets': vm_config.get('sockets', 1),
|
|
510
|
-
'description': vm_config.get('description', '')[:200],
|
|
510
|
+
'description': (vm_config.get('description') or '').replace('\r\n', '\n').replace('\r', '\n').strip()[:200],
|
|
511
511
|
'tags': sorted(tags), # 排序以确保一致性
|
|
512
512
|
'networks': net_config # 添加网络接口配置
|
|
513
513
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/management/commands/run_scheduled_syncs.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0005_align_netboxmodel_timestamps.py
RENAMED
|
File without changes
|
{proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0006_pbsserverconfig_and_more.py
RENAMED
|
File without changes
|
|
File without changes
|
{proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0008_pbsserverconfig_sync_schedule.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0011_pveclusterconfig_notify_on_sync.py
RENAMED
|
File without changes
|
|
File without changes
|
{proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0013_pluginsettings_log_retention.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/migrations/0016_pvevmtasklog_status_textfield.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/templates/pve_sync/inc/vm_sync_button.html
RENAMED
|
File without changes
|
{proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/templates/pve_sync/inc/vm_task_log_panel.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/templates/pve_sync/vm_provisioning_combined.html
RENAMED
|
File without changes
|
{proxsync-2.0.4 → proxsync-2.0.5}/pve_sync_plugin/templates/pve_sync/vm_provisioning_log.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|