Merge "Fixed the TemplateNotFound error in v1 api."
This commit is contained in:
commit
413d012669
@ -91,7 +91,9 @@ from ceilometer.api.v1 import acl
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
blueprint = flask.Blueprint('v1', __name__)
|
||||
blueprint = flask.Blueprint('v1', __name__,
|
||||
template_folder='templates',
|
||||
static_folder='static')
|
||||
|
||||
|
||||
def request_wants_html():
|
||||
|
@ -4,9 +4,9 @@
|
||||
<title>
|
||||
Metering for {{meter}}
|
||||
</title>
|
||||
<link href="/static/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css">
|
||||
<link href="/static/bootstrap/css/bootstrap-responsive.css" rel="stylesheet" type="text/css">
|
||||
<link href="/static/rickshaw.css" rel="stylesheet" type="text/css">
|
||||
<link href="/v1/static/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css">
|
||||
<link href="/v1/static/bootstrap/css/bootstrap-responsive.css" rel="stylesheet" type="text/css">
|
||||
<link href="/v1/static/rickshaw.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@ -80,10 +80,10 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script src="/static/bootstrap/js/bootstrap.js" type="text/javascript"></script>
|
||||
<script src="/static/jquery-1.8.3.js" type="text/javascript"></script>
|
||||
<script src="/static/d3.v2.js" type="text/javascript"></script>
|
||||
<script src="/static/rickshaw.js" type="text/javascript"></script>
|
||||
<script src="/v1/static/bootstrap/js/bootstrap.js" type="text/javascript"></script>
|
||||
<script src="/v1/static/jquery-1.8.3.js" type="text/javascript"></script>
|
||||
<script src="/v1/static/d3.v2.js" type="text/javascript"></script>
|
||||
<script src="/v1/static/rickshaw.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
@ -203,3 +203,9 @@ class TestListEvents(tests_api.TestBase):
|
||||
headers={"X-Roles": "Member",
|
||||
"X-Tenant-Id": "project2"})
|
||||
self.assertEquals(1, len(data['events']))
|
||||
|
||||
def test_template_list_event(self):
|
||||
rv = self.get('/resources/resource-id/meters/instance',
|
||||
headers={"Accept": "text/html"})
|
||||
self.assertEqual(200, rv.status_code)
|
||||
self.assertTrue("text/html" in rv.content_type)
|
||||
|
Loading…
Reference in New Issue
Block a user