--- /dev/null
+recursive-include 3rd_party
\ No newline at end of file
[ui]
url = http://localhost:8000
+# this path should be the seem with data_files installation path
+static_path = /usr/local/share/opnfv_testapi
+
[lfid]
# Linux Foundation cas URL
cas_url = https://identity.linuxfoundation.org/cas/
def make_app():
swagger.docs(base_url=CONF.ui_url,
- static_path=CONF.static_path)
+ static_path=CONF.ui_static_path)
return swagger.Application(
url_mappings.mappings,
debug=CONF.api_debug,
self._set_config_file()
self._parse()
self._parse_per_page()
- self.static_path = os.path.join(
- os.path.dirname(os.path.normpath(__file__)),
- os.pardir,
- 'static')
def _parse(self):
if not os.path.exists(self.config_file):
# static path
(r'/(.*\.(css|png|gif|js|html|json|map|woff2|woff|ttf))',
tornado.web.StaticFileHandler,
- {'path': CONF.static_path}),
+ {'path': CONF.ui_static_path}),
(r'/', root.RootHandler),
(r'/api/v1/auth/signin', sign.SigninHandler),
class RootHandler(handlers.GenericApiHandler):
def get_template_path(self):
- return CONF.static_path
+ return CONF.ui_static_path
@check.login
def get(self):
[files]
packages =
opnfv_testapi
-package_data =
- opnfv_testapi =
- static/*.*
- static/*/*.*
- static/*/*/*.*
- static/*/*/*/*.*
- static/*/*/*/*/*.*
- static/*/*/*/*/*/*.*
- static/*/*/*/*/*/*/*.*
+
data_files =
- /etc/opnfv_testapi =
- etc/config.ini
+ etc/opnfv_testapi = etc/config.ini
+ /usr/local/share/opnfv_testapi = 3rd_party/static/*
[entry_points]
console_scripts =
tag_build =
tag_date = 0
tag_svn_revision = 0
-
-import os
-import subprocess
-
import setuptools
__author__ = 'serena'
except ImportError:
pass
-dirpath = os.path.dirname(os.path.abspath(__file__))
-subprocess.call(['ln', '-s',
- '{}/3rd_party/static'.format(dirpath),
- '{}/opnfv_testapi/static'.format(dirpath)])
setuptools.setup(
- setup_requires=['pbr==2.0.0'],
+ setup_requires=['pbr>=2.0.0'],
pbr=True)