EC-DIGIT-CSIRC/sysdiagnose

[Bug] Can't run the scripts from another folder because of relative paths used

Closed this issue · 5 comments

Te-k commented

If you run the tools from another folder, it wont' work :

$ python ~/tools/forensic/sysdiagnose/initialyze.py file FILE      
Could not read version info, bailing out. Something is wrong: [Errno 2] No such file or directory: 'VERSION.txt'

This is because the get_version function checks for VERSION.txt in the local folder instead of the script folder. It would be nice to allow to run it from another folder

Fixed in cce398f

However, it create a new potential issue:

data folders (extracted data and parsed data) and cases json are created in the folder from where the initialize script is executed. We may want to discuss the expected behavior:

  • its ok like that ...
  • all files should be created in the sysdiagnose folder containing the script
  • we add a init phase where we specify where the config files, exported and parsed data should be stored
  • ?
    To be considered for a refactor of the CLI-UI
Te-k commented

I think the final parsed data should be generated in the local folder or at least have an option to do so, it doesn't seem logical to me to have parsed data in the tool folder.

This will be addressed in a way in the new model of things in the big cleanup PR #64 (work in progress).
In short: for now parsers should always be called from the parsing.py script. In a later iteration we can re-initiate the standalone behaviour of the parsers, whenever we refactor them as subclass of a Parser class.

hmm, now I notice there are much more things that break, keeping this open until we fix it

I think the issues should be solved now.
The case data (case.json, data, parsed_data) will be sitting in the current working directory.