CodeBuilder chokes on input plugin
Describe the bug
In aiida 1.6.8, got an error when trying to use the CodeBuilder (same code worked fine in 2.0).
The error was here: https://github.com/aiidateam/aiida-core/blob/65f7ff8dee171fb158692455be5d25ddc67c0ee5/aiida/orm/utils/builders/code.py#L67
self._get_and_count('input_plugin', used) returned a string (e.g. 'quantumespresso.pw'), which has no .name attribute.
Removing the .name fixed the issue.
Your environment
- Operating system [e.g. Linux]: ubuntu 20.04
- Python version [e.g. 3.7.1]: 3.8
- aiida-core version [e.g. 1.2.1]: 1.6.8
The error in the PR seems to indicate that self._get_and_count('input_plugin', used) can return an entry point or a string, depending on circumstances.
A proper fix will need to take both into account.
Note that the code builder has been deprecated and this will be removed at some point