Skip to content

Commit

Permalink
Merge pull request #2370 from GNS3/fix-2366
Browse files Browse the repository at this point in the history
Create local variable in order to debug issue in the next occurrence,…
  • Loading branch information
ziajka committed Dec 19, 2017
2 parents d8bd33f + e15b717 commit e86ced7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gns3/appliance_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,22 @@ def createNodeFromApplianceId(self, project, appliance_id, x, y):
for appliance in self._appliances:
if appliance["appliance_id"] == appliance_id:
break

project_id = project.id()

if appliance.get("compute_id") is None:
from .main_window import MainWindow
server = server_select(MainWindow.instance(), node_type=appliance["node_type"])
if server is None:
return False
self._controller.post("/projects/" + project.id() + "/appliances/" + appliance_id, self._createNodeFromApplianceCallback, {
self._controller.post("/projects/" + project_id + "/appliances/" + appliance_id, self._createNodeFromApplianceCallback, {
"compute_id": server.id(),
"x": int(x),
"y": int(y)
},
timeout=None)
else:
self._controller.post("/projects/" + project.id() + "/appliances/" + appliance_id, self._createNodeFromApplianceCallback, {
self._controller.post("/projects/" + project_id + "/appliances/" + appliance_id, self._createNodeFromApplianceCallback, {
"x": int(x),
"y": int(y)
},
Expand Down

0 comments on commit e86ced7

Please sign in to comment.