cc1  v2.1
CC1 source code docs
 All Classes Namespaces Files Functions Variables Pages
users.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 # @COPYRIGHT_begin
3 #
4 # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 # @COPYRIGHT_end
19 
20 # Predefined system users
21 # Before using it, add predefined action list_clusters to actions list!
22 from macros import MACRO_GET_CM_ID
23 import settings
24 
25 # Standard administrator account
26 u_admin = settings.USER_ADMIN
27 
28 # Define some fake accounts
29 u_nexists = {'l': 'xxx', 'p': 'xxx', 'cm': MACRO_GET_CM_ID(settings.TEST_CM)}
30 u_pass = {'l': 'cc1', 'p': 'xxx', 'cm': MACRO_GET_CM_ID(settings.TEST_CM)}
31 u_cm = {'l': 'cc1', 'p': 'cc1', 'cm': 999}
32 u_cm_pass = {'l': 'test_user', 'p': 'xxx', 'cm': MACRO_GET_CM_ID(settings.TEST_CM)}
33 
34 
35 # Create some random user accounts:
36 test_users = []
37 for i in range(13):
38  test_users.append({'l': 'test_%d' % i,
39  'p': 'password%d' % i,
40  'cm': MACRO_GET_CM_ID(settings.TEST_CM),
41  'cm_p': '%s%d' % (settings.USER_PASSWORD_PREFIX, i),
42  'act_key': 'terefere',
43  'organization': 'Registration and Login test, account %d' % i,
44  'email': 'test_user_%d@cc1.ifj.edu.pl' % i,
45  'first': 'Test%d' % i,
46  'last': 'User'})
47 
48 # Define random users, as normal, cmadmin and clmadmin
49 u_new = test_users[0]
50 u_admin_cm = test_users[11]
51 u_admin_clm = test_users[10]
52