This moves the location of the fedmsg import statements so that it is only imported when it is turned on.
This is beneficial for users who do not use fedmsg but use ResultsDB.
Details
Diff Detail
- Repository
- rRSDB resultsdb
- Branch
- fedmsg-imports (branched from develop)
- Lint
Lint OK - Unit
No Unit Test Coverage - Build Status
Buildable 906 Build 906: arc lint + arc unit
I'm not a huge fan of imports needlessly being in the middle of the code. This would IMO work equally if the conditional import was (e.g.) just before the QUERY_LIMIT in the "header" part.
Also - what is the actual benefit of doing that? I'm almost certain that it's not "doing one less import, just for the fun of it", but fail to see the actual use-case.
@jskladan I believe I addressed your concern in the latest commit. Please let me know your thoughts.
The reason why I created this PR is that we are in the process of deploying ResultsDB as a standalone service, but we will not be using fedmsg. By making the import conditional, it allows us to avoid installing fedmsg on our servers since it isn't needed.
Code looks good. Thanks!
OK, but fedmsg package is required by the resultsdb package, so this would need specfile changes as well, right? Because as it is, the fedmsg won't be imported, but the dependency is still there.