2 from PLC.Faults import *
3 from PLC.Method import Method
4 from PLC.Parameter import Parameter, Mixed
5 from PLC.Auth import Auth
7 class GetSlicesMD5(Method):
9 Returns the current md5 hash of slices.xml file
13 roles = ['admin', 'pi', 'user', 'tech', 'node']
19 returns = Parameter(str, "MD5 hash of slices.xml")
24 file_path = '/var/www/html/xml/slices-0.5.xml.md5'
25 slices_md5 = file(file_path).readline().strip()
28 raise PLCInvalidArgument, "File is empty"
30 raise PLCInvalidArgument, "No such file"