|
7 | 7 | import argparse |
8 | 8 | import dsFunc |
9 | 9 |
|
10 | | -secretsVersion = input('To edit production server, enter the name of the \ |
11 | | -secrets file: ') |
12 | | -if secretsVersion != '': |
13 | | - try: |
14 | | - secrets = __import__(secretsVersion) |
15 | | - print('Editing Production') |
16 | | - except ImportError: |
17 | | - secrets = __import__('secrets') |
18 | | - print('Editing Development') |
19 | | -else: |
20 | | - secrets = __import__('secrets') |
21 | | - print('Editing Development') |
| 10 | +inst = input('To edit production server, enter the name of the secrets file: ') |
| 11 | +secrets = dsFunc.instSelect(inst) |
| 12 | + |
| 13 | +baseURL = secrets.baseURL |
| 14 | +email = secrets.email |
| 15 | +password = secrets.password |
| 16 | +filePath = secrets.filePath |
| 17 | +verify = secrets.verify |
| 18 | +skipColl = secrets.skipColl |
22 | 19 |
|
23 | 20 | parser = argparse.ArgumentParser() |
24 | 21 | parser.add_argument('-k', '--key', help='the key to be added. optional - if \ |
|
50 | 47 |
|
51 | 48 | urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) |
52 | 49 |
|
53 | | -baseURL = secrets.baseURL |
54 | | -email = secrets.email |
55 | | -password = secrets.password |
56 | | -filePath = secrets.filePath |
57 | | -verify = secrets.verify |
58 | | -skippedCollections = secrets.skippedCollections |
59 | | - |
60 | 50 | startTime = time.time() |
61 | 51 | data = {'email': email, 'password': password} |
62 | 52 | header = {'content-type': 'application/json', 'accept': 'application/json'} |
|
81 | 71 | verify=verify).json() |
82 | 72 | for j in range(0, len(collections)): |
83 | 73 | collectionID = collections[j]['uuid'] |
84 | | - if collectionID not in skippedCollections: |
| 74 | + if collectionID not in skipColl: |
85 | 75 | offset = 0 |
86 | 76 | items = '' |
87 | 77 | while items != []: |
|
102 | 92 | itemID = items[k]['uuid'] |
103 | 93 | itemList.append(itemID) |
104 | 94 | offset = offset + 200 |
105 | | - |
| 95 | + |
106 | 96 | dsFunc.elapsedTime(startTime, 'Item list creation time') |
107 | 97 |
|
108 | 98 | recordsEdited = 0 |
|
0 commit comments