Commit ac300a7e authored by Celine Noirot's avatar Celine Noirot
Browse files

add control of space name.

parent f322a5f8
......@@ -30,7 +30,7 @@ class AddProject (Workflow):
self.add_parameter("admin_login", "The login of a ng6 administrator", required = True, type = ng6adminlogin)
self.add_parameter("project_name", "Give a name to your project (has to be unique)", flag = "--name", required = True, type = uniqproject)
self.add_parameter("project_description", "Give a description to your project", flag = "--description", required = True)
self.add_parameter("space", "Where to store data", flag = "--space", default="default")
self.add_parameter("space", "Where to store data", flag = "--space", default="default", type="ng6space")
def process(self):
project = Project(self.project_name, self.project_description, self.admin_login, None, self.space)
......
......@@ -91,6 +91,13 @@ def existingprojectid(id):
except :
raise argparse.ArgumentTypeError("The project id '%s' does not exists" % id)
def ng6space(val):
try :
ng6conf = NG6ConfigReader()
ng6conf.get_space_directory(val)
except :
raise argparse.ArgumentTypeError("The space name '%s' is not define in application.properties" % val)
def existingrun(id):
try:
t3mysql = t3MySQLdb()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment