Allow changing location only for local usage

This commit is contained in:
Julien Duponchelle committed 2015-01-23 16:58:14 +01:00
1 parent 4f2764c0b4
commit 017c5ac9f6
3 files changed
+34 -25

No files matched your search

+5
View File
@@ -20,6 +20,7 @@ import os
import tempfile
import shutil
from uuid import UUID, uuid4
from ..config import Config
class Project:
@@ -46,6 +47,10 @@ class Project:
self._location = location
if location is None:
self._location = tempfile.mkdtemp()
else:
config = Config.instance().get_section_config("Server")
if config.get("local", False) is False:
raise aiohttp.web.HTTPForbidden(text="You are not allowed to modifiy the project directory location")
self._temporary = temporary
self._vms = set()