Revision 9ff114c3 snf-stats-app/synnefo_stats/grapher.py
b/snf-stats-app/synnefo_stats/grapher.py | ||
---|---|---|
32 | 32 |
# or implied, of GRNET S.A. |
33 | 33 |
|
34 | 34 |
from django.http import HttpResponse |
35 |
from django.utils.encoding import smart_unicode |
|
35 | 36 |
|
36 | 37 |
import gd |
37 | 38 |
import os |
... | ... | |
46 | 47 |
|
47 | 48 |
from synnefo_stats import settings |
48 | 49 |
|
49 |
from synnefo.util.text import uenc |
|
50 | 50 |
from snf_django.lib.api import faults, api_method |
51 | 51 |
|
52 | 52 |
from logging import getLogger |
... | ... | |
252 | 252 |
@api_method(http_method='GET', token_required=False, user_required=False, |
253 | 253 |
format_allowed=False, logger=log) |
254 | 254 |
def grapher(request, graph_type, hostname): |
255 |
hostname = decrypt(uenc(hostname))
|
|
256 |
fname = uenc(os.path.join(settings.RRD_PREFIX, hostname))
|
|
255 |
hostname = decrypt(smart_unicode(hostname))
|
|
256 |
fname = smart_unicode(os.path.join(settings.RRD_PREFIX, hostname))
|
|
257 | 257 |
if not os.path.isdir(fname): |
258 | 258 |
raise faults.ItemNotFound('No such instance') |
259 | 259 |
|
260 |
outfname = uenc(os.path.join(settings.GRAPH_PREFIX, hostname))
|
|
260 |
outfname = smart_unicode(os.path.join(settings.GRAPH_PREFIX, hostname))
|
|
261 | 261 |
draw_func = available_graph_types[graph_type] |
262 | 262 |
|
263 | 263 |
response = HttpResponse(draw_func(fname, outfname), |
Also available in: Unified diff