Changeset 2601


Ignore:
Timestamp:
Oct 14, 2016, 12:36:42 PM (3 years ago)
Author:
kbut
Message:

encode result for send message

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lliurex-mirror/trunk/fuentes/n4d-lliurex-mirror.install/usr/share/n4d/python-plugins/MirrorManager.py

    r2600 r2601  
    1818from urllib2 import urlopen
    1919import string
     20import subprocess
    2021
    2122class MirrorManager:
     
    670671
    671672        def get_last_log(self):
    672                 import subproces
    673                 p = subproces.Popen('lliurex-mirror-get-last-log',stdout=subproces.PIPE)
    674                 path = p.communicate()[0]
     673                import base64
     674                p = subprocess.Popen('lliurex-mirror-get-last-log',stdout=subprocess.PIPE)
     675                path = p.communicate()[0].strip()
    675676                f = open(path,'r')
    676677                content = f.readlines()
    677                 onelinecontent = '\n'.join(content)
    678                 return {'status':True,'msg':onelinecontent}
    679 
    680 
    681 
     678                onelinecontent = ''.join(content)
     679                return {'status':True,'msg':base64.b64encode(onelinecontent)}
     680
     681
     682
Note: See TracChangeset for help on using the changeset viewer.