diff options
author | Marcel Enguehard <mengueha+fdio@cisco.com> | 2017-07-19 11:26:26 +0200 |
---|---|---|
committer | Marcel Enguehard <mengueha+fdio@cisco.com> | 2017-07-19 11:51:26 +0000 |
commit | 3e6678f9c692553e8902da4d6fb1fe6c087db1f4 (patch) | |
tree | 580a46ca5de22a044319eabb295ad980d50589ec /vicn/core/api.py | |
parent | 08c4f765cf29dbd6e9a616c542552417eece14fc (diff) |
* GUI resource
* MemIf interface for VPP
* Better netmodel integration
* Draft documentation
* New tutorials
* Improved monitoring and error handling
* Refactored IP addresses and prefixes representation
* Improved image mgmt for LXD
* Various bugfixes and code refactoring
Change-Id: I90da6cf7b5716bc7deb6bf4e24d3f9f01b5a9b0f
Signed-off-by: Marcel Enguehard <mengueha+fdio@cisco.com>
Diffstat (limited to 'vicn/core/api.py')
-rw-r--r-- | vicn/core/api.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/vicn/core/api.py b/vicn/core/api.py index 708e2581..ccbb9b24 100644 --- a/vicn/core/api.py +++ b/vicn/core/api.py @@ -19,6 +19,7 @@ import asyncio import json import logging +import os import resource as ulimit import sys @@ -51,6 +52,7 @@ class API(metaclass = Singleton): def terminate(self): # XXX not valid if nothing has been initialized ResourceManager().terminate() + os._exit(0) def parse_topology_file(self, topology_fn, resources, settings): log.info("Parsing topology file %(topology_fn)s" % locals()) @@ -87,7 +89,7 @@ class API(metaclass = Singleton): if nofile is not None and nofile > 0: if nofile < 1024: log.error('Too few allowed open files for the process') - import os; os._exit(1) + os._exit(1) log.info('Setting open file descriptor limit to {}'.format( nofile)) @@ -95,15 +97,18 @@ class API(metaclass = Singleton): ulimit.RLIMIT_NOFILE, (nofile, nofile)) - ResourceManager(base=scenario[-1], settings=settings) + base = os.path.dirname(scenario_list[-1]) + base = os.path.abspath(base) + ResourceManager(base = base, settings = settings) for resource in resources: try: ResourceManager().create_from_dict(**resource) except Exception as e: + import traceback; traceback.print_exc() log.error("Could not create resource '%r': %r" % \ (resource, e,)) - import os; os._exit(1) + os._exit(1) self._configured = True |