Skip to content
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

Refactor modify_config method #87

Merged
merged 38 commits into from
Dec 28, 2018
Merged

Refactor modify_config method #87

merged 38 commits into from
Dec 28, 2018

Conversation

bjoernricks
Copy link
Member

Split modify_config method into several distinct methods for each use case.

Add test for checking if a deprecation warning is raised when passing
a string as alert_ids to create_task method.
modify_config supports at least four different modes via the selection
argument and the availibility of different parameters. This can't be
mapped very well to a single function/method and therefore new more
specific modify_config_set_ methods are introduced for the different
use cases.
@bjoernricks bjoernricks requested review from wiegandm and a team December 21, 2018 12:13
sphinx interpreted the modify_config_set_ string as a reference to
another section or link.
@codecov
Copy link

codecov bot commented Dec 21, 2018

Codecov Report

Merging #87 into master will increase coverage by 10.84%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #87       +/-   ##
===========================================
+ Coverage   77.16%   88.01%   +10.84%     
===========================================
  Files          10       10               
  Lines        2308     2377       +69     
===========================================
+ Hits         1781     2092      +311     
+ Misses        527      285      -242
Impacted Files Coverage Δ
gvm/utils.py 100% <100%> (ø) ⬆️
gvm/protocols/gmpv7.py 91.6% <100%> (+13.63%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f3cde96...73138e0. Read the comment docs.

wiegandm
wiegandm previously approved these changes Dec 24, 2018
Also don't add credential_type to the modify_credential request. It
seems the protocol doesn't allow for the type parameter.
Handle allow_insecure argument of modify_credential as a boolean
Don't ignore them silently if an empty string is passed. Either set the
passed value as empty in the request or raise an error.
The logic in modify_credential could be improved if it would be
validated against the implemented protocol in gvmd. Currently it follows
the spec only mostly.
* port argument should be an int
* threat, new_threat should be one of High, Medium, Low, Alarm, Log,
  Debug
* severity, new_severity should be a decimal value
* hosts will be joined without an extra space
Both params are mentioned in the protocol docs but aren't in the docs
for the modify commands and also aren't available in gsad. Therefore
remove them from create commands.
Use same checks as create_permission
The exception is raised within import_report method
The comment of a report isn't used (at least not in gsa) so there is no
need to update it.
@bjoernricks bjoernricks merged commit b114e70 into greenbone:master Dec 28, 2018
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.

None yet

2 participants