|
16 | 16 | limitations under the License. |
17 | 17 |
|
18 | 18 |
|
19 | | -Accessible Modules Redis Interface |
| 19 | +Accessible Modules Kvdb Interface |
20 | 20 | """ |
21 | 21 |
|
22 | 22 | __license__ = "Apache-2.0" |
23 | 23 | __author__ = "Anika Weinmann, Carmen Tawalika, Guido Riembauer, Julia Haas" |
24 | 24 | __copyright__ = "Copyright 2021 - 2022, mundialis GmbH & Co. KG" |
25 | 25 | __maintainer__ = "mundialis GmbH & Co. KG" |
26 | 26 |
|
27 | | -from actinia_core.core.redis_user import RedisUserInterface |
| 27 | +from actinia_core.core.kvdb_user import KvdbUserInterface |
28 | 28 | from actinia_core.core.common.config import Configuration |
29 | 29 |
|
30 | 30 |
|
31 | | -def getAccessibleModuleListRedis(self): |
32 | | - redis_interface = RedisUserInterface() |
| 31 | +def getAccessibleModuleListKvdb(self): |
| 32 | + kvdb_interface = KvdbUserInterface() |
33 | 33 | conf = Configuration() |
34 | 34 | try: |
35 | 35 | conf.read() |
36 | 36 | except Exception: |
37 | 37 | pass |
38 | 38 |
|
39 | | - server = conf.REDIS_SERVER_URL |
40 | | - port = conf.REDIS_SERVER_PORT |
41 | | - if conf.REDIS_SERVER_PW: |
42 | | - redis_password = conf.REDIS_SERVER_PW |
| 39 | + server = conf.KVDB_SERVER_URL |
| 40 | + port = conf.KVDB_SERVER_PORT |
| 41 | + if conf.KVDB_SERVER_PW: |
| 42 | + kvdb_password = conf.KVDB_SERVER_PW |
43 | 43 | else: |
44 | | - redis_password = None |
45 | | - redis_interface.connect(host=server, port=port, password=redis_password) |
| 44 | + kvdb_password = None |
| 45 | + kvdb_interface.connect(host=server, port=port, password=kvdb_password) |
46 | 46 | user = self.user.get_id() |
47 | | - access_modules = redis_interface.get_credentials(user)["permissions"][ |
| 47 | + access_modules = kvdb_interface.get_credentials(user)["permissions"][ |
48 | 48 | "accessible_modules" |
49 | 49 | ] |
50 | | - redis_interface.disconnect() |
| 50 | + kvdb_interface.disconnect() |
51 | 51 | return access_modules |
52 | 52 |
|
53 | 53 |
|
54 | | -def addGrassAddonToModuleListRedis(self, grassmodule): |
| 54 | +def addGrassAddonToModuleListKvdb(self, grassmodule): |
55 | 55 | """ |
56 | 56 | This function adds installed GRASS addon to the user's module list |
57 | | - in redis. |
| 57 | + in kvdb. |
58 | 58 | """ |
59 | 59 | self.user.add_accessible_modules( |
60 | 60 | [ |
|
0 commit comments