ubc-systopia / Indaleko

Indaleko Project
GNU Affero General Public License v3.0
0 stars 1 forks source link

IndalekoWindowsMachineConfig.py "--list" operation is not working #17

Closed fsgeek closed 7 months ago

fsgeek commented 7 months ago

Some change has broken listing the machine configurations. This needs to be fixed.

fsgeek commented 7 months ago

Here is the error:

PS C:\Users\TonyMason\source\repos\indaleko-test> py .\IndalekoWindowsMachineConfig.py --list Listing machine configurations in the database. Traceback (most recent call last): File "C:\Users\TonyMason\source\repos\indaleko-test\IndalekoWindowsMachineConfig.py", line 296, in main() File "C:\Users\TonyMason\source\repos\indaleko-test\IndalekoWindowsMachineConfig.py", line 263, in main configs = IndalekoWindowsMachineConfig.find_configs_in_db() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\TonyMason\source\repos\indaleko-test\IndalekoWindowsMachineConfig.py", line 75, in find_configs_in_db return IndalekoMachineConfig.find_configs_in_db(source_id=source_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\TonyMason\source\repos\indaleko-test\IndalekoMachineConfig.py", line 247, in find_configs_in_db entries = machine_config_collection.find_entries(**{'Record.Source Identifier.Identifier':source_id}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\TonyMason\source\repos\indaleko-test\IndalekoCollections.py", line 126, in find_entries return [document for document in self.collection.find(kwargs)] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\TonyMason\AppData\Local\Programs\Python\Python312\Lib\site-packages\arango\collection.py", line 798, in find return self._execute(request, response_handler) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\TonyMason\AppData\Local\Programs\Python\Python312\Lib\site-packages\arango\api.py", line 74, in _execute return self._executor.execute(request, response_handler) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\TonyMason\AppData\Local\Programs\Python\Python312\Lib\site-packages\arango\executor.py", line 66, in execute return response_handler(resp) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\TonyMason\AppData\Local\Programs\Python\Python312\Lib\site-packages\arango\collection.py", line 795, in response_handler raise DocumentGetError(resp, request) arango.exceptions.DocumentGetError: [HTTP 400][ERR 1501] AQL: syntax error, unexpected identifier near 'Source Identifier.Identifier =...' at position 3:3 7 (while parsing)

fsgeek commented 7 months ago

See commit 10bdd3c for a resolution.

The change in the shape of the MachineConfig data - using the "Record" type - makes the query to retrieve the entries more complex. This uses explicit AQL to perform the lookups. It now seems to be working again.