mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +00:00
Fix symlink not being created for duplicated IOU devices. Fixes https://github.com/GNS3/gns3-gui/issues/2699
This commit is contained in:
parent
4ecd3b2015
commit
589c9754e8
@ -276,7 +276,7 @@ class BaseManager:
|
|||||||
destination_dir = destination_node.working_dir
|
destination_dir = destination_node.working_dir
|
||||||
try:
|
try:
|
||||||
shutil.rmtree(destination_dir)
|
shutil.rmtree(destination_dir)
|
||||||
shutil.copytree(source_node.working_dir, destination_dir)
|
shutil.copytree(source_node.working_dir, destination_dir, symlinks=True, ignore_dangling_symlinks=True)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise aiohttp.web.HTTPConflict(text="Can't duplicate node data: {}".format(e))
|
raise aiohttp.web.HTTPConflict(text="Can't duplicate node data: {}".format(e))
|
||||||
|
|
||||||
|
@ -522,8 +522,9 @@ class IOUVM(BaseNode):
|
|||||||
# on newer images, see https://github.com/GNS3/gns3-server/issues/1484
|
# on newer images, see https://github.com/GNS3/gns3-server/issues/1484
|
||||||
try:
|
try:
|
||||||
symlink = os.path.join(self.working_dir, os.path.basename(self.path))
|
symlink = os.path.join(self.working_dir, os.path.basename(self.path))
|
||||||
if not os.path.islink(symlink):
|
if os.path.islink(symlink):
|
||||||
os.symlink(self.path, symlink)
|
os.unlink(symlink)
|
||||||
|
os.symlink(self.path, symlink)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise IOUError("Could not create symbolic link: {}".format(e))
|
raise IOUError("Could not create symbolic link: {}".format(e))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user