Skip to content

Containers#41

Merged
mkumykov merged 8 commits intomasterfrom
containers
Apr 22, 2019
Merged

Containers#41
mkumykov merged 8 commits intomasterfrom
containers

Conversation

@mkumykov
Copy link
Contributor

Added few functions to support layer by layer scan for container images as well as a tool to perform such scan

@mkumykov mkumykov requested a review from gsnyder2007 April 22, 2019 14:12
Copy link
Contributor

@gsnyder2007 gsnyder2007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to HubRestApi.py are fine so I'm approving. Treat my other feedback as suggestions only.

main_data = main_project_release['_meta']['href'].split('/')
sub_data = sub_project_release['_meta']['href'].split('/')
url = self.get_apibase() + "/v1/releases/" + main_data[7] + "/component-bom-entries"
print (url)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid using print and use logging.debug instead

payload['producerProject']['id'] = sub_data[5]
payload['producerRelease'] = {}
payload['producerRelease']['id'] = sub_data[7]
print (json.dumps(payload))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logging.debug in place of print please

main_data = main_project_release['_meta']['href'].split('/')
sub_data = sub_project_release['_meta']['href'].split('/')
url = self.get_apibase() + "/v1/releases/" + main_data[7] + "/component-bom-entries"
print (url)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logging.debug

entity['entityKey']['entityId'] = sub_data[7]
entity['entityKey']['entityType'] = 'RL'
payload.append(entity)
print (json.dumps(payload))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logging.debug


def main(argv=None):

if argv is None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does use of ArgumentParser make this code (argv) redundant?

'''
quick and dirty wrapper to process some docker functionality
'''
class docker_wrapper():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit, but does this class name conform to Python styling conventions? Camel case?

data = json.load(fp)
return data

class detector():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Camel case? i.e. Detector instead of detector?

cmd.extend(options)
subprocess.run(cmd)

class container_image_scanner():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Camel case?

@mkumykov mkumykov merged commit 5c771a4 into master Apr 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants