Drop code for temporary projects

Fix https://github.com/GNS3/gns3-gui/issues/982
This commit is contained in:
Julien Duponchelle committed 2016-05-24 17:57:04 +02:00
1 parent df73f80bf5
commit a797038aeb
12 files changed
+25 -224

No files matched your search

+6 -9
View File
@@ -46,16 +46,14 @@ class Controller:
self._config_file = os.path.join(config_path, "gns3_controller.conf")
server_config = Config.instance().get_section_config("Server")
print(server_config)
if server_config.getboolean("local", False) is True:
print("MMOOOOOOONKEYYYYYY")
self._computes["local"] = Compute(compute_id="local",
controller=self,
protocol=server_config.get("protocol", "http"),
host=server_config.get("host", "localhost"),
port=server_config.getint("port", 3080),
user=server_config.get("user", ""),
password=server_config.get("password", ""))
controller=self,
protocol=server_config.get("protocol", "http"),
host=server_config.get("host", "localhost"),
port=server_config.getint("port", 3080),
user=server_config.get("user", ""),
password=server_config.get("password", ""))
def save(self):
"""
@@ -107,7 +105,6 @@ class Controller:
"""
if compute_id not in self._computes:
# We disallow to create from the outside the
if compute_id == 'local':
return None
+1 -10
View File
@@ -34,10 +34,9 @@ class Project:
:param project_id: force project identifier (None by default auto generate an UUID)
:param path: path of the project. (None use the standard directory)
:param temporary: boolean to tell if the project is a temporary project (destroy when closed)
"""
def __init__(self, name=None, project_id=None, path=None, temporary=False, controller=None):
def __init__(self, name=None, project_id=None, path=None, controller=None):
self._controller = controller
self._name = name
@@ -54,7 +53,6 @@ class Project:
path = os.path.join(get_default_project_directory(), self._id)
self.path = path
self._temporary = temporary
self._computes = set()
self._nodes = {}
self._links = {}
@@ -74,10 +72,6 @@ class Project:
def id(self):
return self._id
@property
def temporary(self):
return self._temporary
@property
def path(self):
return self._path
@@ -126,14 +120,12 @@ class Project:
yield from compute.post("/projects", data={
"name": self._name,
"project_id": self._id,
"temporary": self._temporary,
"path": self._path
})
else:
yield from compute.post("/projects", data={
"name": self._name,
"project_id": self._id,
"temporary": self._temporary
})
self._project_created_on_compute.add(compute)
@@ -235,6 +227,5 @@ class Project:
return {
"name": self._name,
"project_id": self._id,
"temporary": self._temporary,
"path": self._path
}