using ./manage.py clone_rules fails for ssh git urls with the following stack trace:
[1/1] Cloning git@git.[redacted]... /var/folders/2_/s6d7t49d2y79bvm0tzqb585m9b4smz/T/YaraRules.git
Traceback (most recent call last):
File "./manage.py", line 681, in <module>
main()
File "./manage.py", line 677, in main
manager.run(args.command)
File "./manage.py", line 528, in run
getattr(self, command)() # Command validation already happened in the ArgumentParser.
File "./manage.py", line 597, in clone_rules
clone_rules.clone_remote_rules()
File "/Users/[redacted]/dev/binary_alert_project/binaryalert/rules/clone_rules.py", line 87, in clone_remote_rules
files_copied = _clone_repo(source['url'], source.get('include'), source.get('exclude'))
File "/Users/[redacted]/dev/binary_alert_project/binaryalert/rules/clone_rules.py", line 58, in _clone_repo
target_repo_root = os.path.join(RULES_DIR, url.split('//')[1])
IndexError: list index out of range
Desired Change
Add split logic for ssh urls which do not contain //
Background
using
./manage.py clone_rules
fails for ssh git urls with the following stack trace:Desired Change
Add
split
logic for ssh urls which do not contain//