1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter, Mixed
4 from PLC.Auth import Auth
6 class GetSlicesMD5(Method):
8 Returns the current md5 hash of slices.xml file
12 roles = ['admin', 'pi', 'user', 'tech', 'node']
18 returns = Parameter(str, "MD5 hash of slices.xml")
23 file_path = '/var/www/html/xml/slices-0.5.xml.md5'
24 slices_md5 = file(file_path).readline().strip()
27 raise PLCInvalidArgument, "File is empty"
29 raise PLCInvalidArgument, "No such file"