- nfvo.start_service(mydb)
-
- httpthread = httpserver.httpserver(mydb, False, global_config['http_host'], global_config['http_port'])
+ if create_tenant:
+ try:
+ nfvo.new_tenant(mydb, {"name": create_tenant})
+ except Exception as e:
+ if isinstance(e, nfvo.NfvoException) and e.http_code == 409:
+ pass # if tenant exist (NfvoException error 409), ignore
+ else: # otherwise print and error and continue
+ logger.error("Cannot create tenant '{}': {}".format(create_tenant, e))
+
+ # WIM module
+ wim_persistence = WimPersistence(mydb)
+ wim_engine = WimEngine(wim_persistence)
+ # ---
+ nfvo.start_service(mydb, wim_persistence, wim_engine)
+
+ httpthread = httpserver.httpserver(
+ mydb, False,
+ global_config['http_host'], global_config['http_port'],
+ wim_persistence, wim_engine
+ )