-
Notifications
You must be signed in to change notification settings - Fork 105
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
Adding check for project-version-violations and report back #55
base: master
Are you sure you want to change the base?
Conversation
@@ -1240,6 +1241,32 @@ def get_project_info(self, project_name, link_name): | |||
else: | |||
return {} # nada | |||
|
|||
def get_project_violation_status(self, project_name, version): | |||
|
|||
project = self.get_project_by_name(project_name) |
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.
did you consider using self.get_project_version_by_name? would replace use of get_project_by_name and the subsequent code to retrieve the version if present, e.g. this method would then become,
def get_project_violation_status(self, project_name, version):
version = self.get_project_version_by_name(project_name, version)
if version:
return version.get('policyStatus', None)
else:
return "{}:{} not found".format(project_name, version)
or something along those lines?
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.
Ah, well I believe I was looking at it this way because it is a more precise error. If I remember get_project_version_by_name will return a non 200 on both missing projects or versions. and I wanted to tell my users what was missing the project or the version or if the server was just miss-behaving
Oh wow.. Just saw this... I'll go through them now.. |
The function was working fine until we updated the version to 56 and we are facing this error @gsnyder2007 can you please take a look and let us know what api we can use instead? |
bringing my fork up to date
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.
adjustments made..
No description provided.