leverage LFID authentication to pod creation
[releng.git] / utils / test / testapi / opnfv_testapi / common / message.py
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'
11
12
13 def key_error(key):
14     return "KeyError: '{}'".format(key)
15
16
17 def no_body():
18     return 'No Body'
19
20
21 def not_found(key, value):
22     return '{} {} [{}]'.format(not_found_base, key, value)
23
24
25 def missing(name):
26     return '{} Missing'.format(name)
27
28
29 def exist(key, value):
30     return '{} [{}] {}'.format(key, value, exist_base)
31
32
33 def bad_format(error):
34     return 'Bad Format [{}]'.format(error)
35
36
37 def unauthorized():
38     return 'No Authentication Header'
39
40
41 def invalid_token():
42     return 'Invalid Token'
43
44
45 def not_login():
46     return 'TestAPI id is not provided'
47
48
49 def not_lfid():
50     return 'Not a valid Linux Foundation Account'
51
52
53 def no_update():
54     return 'Nothing to update'
55
56
57 def must_int(name):
58     return '{} must be int'.format(name)