-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rose-arch: Raise error for duplicate targets. #2138
Conversation
lib/python/rose/apps/rose_arch.py
Outdated
|
||
# Don't permit duplicate targets. | ||
if s_key_tail in s_key_tails: | ||
raise Exception('%s: Duplicate target "%s".' % ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend that you raise a ConfigValueError
.
(Travis CI failure safe to ignore.) |
@sadielbartholomew please sanity check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot & solution! PR fix makes sense & works, though did notice a docstring typo.
@@ -39,6 39,13 @@ | |||
from time import gmtime, strftime, time | |||
|
|||
|
|||
class RoseArchDuplicateError(ConfigValueError): | |||
|
|||
"""An exception raised if dupluicate archive targets are provided.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: 'dupluicate'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging and amending typo quickly with a separate PR, as advised by Matt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Fix docstring typo from #2138 merge
It is possible to pass rose arch a pair of duplicate targets using the
[arch:(target)]
syntax e.g:This PR catches the configuration error before it surfaces from sqlite to provide a more helpful error.