Tools for GNS3 GUI
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

0007-Tools-Support-GNS3-configuration-profiles.patch 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From 283cd897498b0f26f7522ef7c672553bd358a2e3 Mon Sep 17 00:00:00 2001
  2. From: Bernhard Ehlers <be@bernhard-ehlers.de>
  3. Date: Wed, 22 May 2019 11:40:52 +0200
  4. Subject: [PATCH 7/7] Tools - Support GNS3 configuration profiles
  5. ---
  6. gns3/tool.py | 6 +++++-
  7. tools.md | 5 +++--
  8. 2 files changed, 8 insertions(+), 3 deletions(-)
  9. diff --git a/gns3/tool.py b/gns3/tool.py
  10. index 90441612..0476a2cd 100644
  11. --- a/gns3/tool.py
  12. +++ b/gns3/tool.py
  13. @@ -32,6 +32,7 @@ from .items.node_item import NodeItem
  14. from .items.link_item import LinkItem
  15. from .items.text_item import TextItem
  16. from .items.drawing_item import DrawingItem
  17. +from .local_config import LocalConfig
  18. log = logging.getLogger(__name__)
  19. @@ -166,7 +167,10 @@ end run
  20. if not project:
  21. return
  22. - args = [self._path, __version__, project.id()]
  23. + profile = LocalConfig.instance().profile()
  24. + if not profile:
  25. + profile = "default"
  26. + args = [self._path, __version__, profile, project.id()]
  27. for item in item_list:
  28. if isinstance(item, NodeItem):
  29. args.append("nodes/" + item.node().node_id())
  30. diff --git a/tools.md b/tools.md
  31. index f60652ac..dfbf68c9 100644
  32. --- a/tools.md
  33. +++ b/tools.md
  34. @@ -11,8 +11,9 @@ called by the GUI with the following parameters:
  35. | No. | Parameter |
  36. |------|--------------------------------------------|
  37. | 1 | GNS3 version (for compatibility checks) |
  38. -| 2 | Project UUID |
  39. -| 3+ | List of selected items, can be empty |
  40. +| 2 | GNS3 configuration profile |
  41. +| 3 | Project UUID |
  42. +| 4+ | List of selected items, can be empty |
  43. An item consists of it's UUID prefixed by `nodes/`
  44. for node items, `text_drawings/` for text items
  45. --
  46. 2.15.1 (Apple Git-101)