1 ##############################################################################
2 # Copyright (c) 2017 ZTE Corp
3 # feng.xiaowei@zte.com.cn
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 not_found_base = 'Could Not Found'
10 exist_base = 'Already Exists'
14 return "KeyError: '{}'".format(key)
21 def not_found(key, value):
22 return '{} {} [{}]'.format(not_found_base, key, value)
26 return '{} Missing'.format(name)
29 def invalid_value(name, options):
30 return '{} must be in {}'.format(name, options)
33 def exist(key, value):
34 return '{} [{}] {}'.format(key, value, exist_base)
37 def bad_format(error):
38 return 'Bad Format [{}]'.format(error)
42 return 'No Authentication Header'
46 return 'Invalid Token'
50 return 'TestAPI id is not provided'
54 return 'Not a valid Linux Foundation Account'
58 return 'Nothing to update'
62 return '{} must be int'.format(name)