Skip to content

Commit

Permalink
Install custom symbols. Fixes #2492
Browse files Browse the repository at this point in the history
grossmj committed Jan 29, 2025
1 parent f2bb785 commit 2516b19
Showing 3 changed files with 20 additions and 40 deletions.
14 changes: 14 additions & 0 deletions gns3server/controller/__init__.py
Original file line number Diff line number Diff line change
@@ -74,6 +74,7 @@ async def start(self, computes=None):

log.info("Controller is starting")
await self._install_base_configs()
await self._install_custom_symbols()
installed_disks = await self._install_builtin_disks()
if installed_disks:
await update_disk_checksums(installed_disks)
@@ -371,6 +372,19 @@ async def _install_builtin_disks(self):
except OSError as e:
log.error(f"Could not install disk files to {dst_path}: {e}")

async def _install_custom_symbols(self):
"""
At startup we copy custom symbols to the user location to allow
them to use with appliances
"""

dst_path = self.symbols.symbols_path()
log.info(f"Installing custom symbols in '{dst_path}'")
try:
return await Controller.install_resource_files(dst_path, "custom_symbols", upgrade_resources=False)
except OSError as e:
log.error(f"Could not install custom symbols to {dst_path}: {e}")

def images_path(self):
"""
Get the image storage directory
39 changes: 0 additions & 39 deletions gns3server/custom_symbols/README.rst

This file was deleted.

7 changes: 6 additions & 1 deletion scripts/sync_appliances.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# Copyright (C) 2016 GNS3 Technologies Inc.
#
@@ -21,10 +21,15 @@

rm gns3server/appliances/*
rmdir gns3server/appliances
rm gns3server/custom_symbols/*
rmdir gns3server/custom_symbols
rm -Rf /tmp/gns3-registry

git clone https://github.com/GNS3/gns3-registry.git /tmp/gns3-registry
mv /tmp/gns3-registry/appliances gns3server/appliances
mv /tmp/gns3-registry/symbols gns3server/custom_symbols
rm gns3server/custom_symbols/*.{txt,rst,md}

git add gns3server/appliances/*
git add gns3server/custom_symbols/*
git commit -m "Sync appliances"

0 comments on commit 2516b19

Please sign in to comment.