Skip to content
This repository has been archived by the owner on Nov 29, 2021. It is now read-only.

Add support for configuration file. #122

Merged
merged 5 commits into from
Jul 31, 2019
Merged

Conversation

jjnicola
Copy link
Member

@jjnicola jjnicola commented Jul 31, 2019

All option have a default value. This option are overwritten if this
option is passed as command line argument.
If there is config file, is loaded and the option
listed in it will be set as the valid one, but they will be still
overwritten by the ones passed as cmd option.
This means that cmd options have priority over the other ones.

The config file must have a section with the wrapper name. As ospd
is a base lib for multiple wrappers, each wrapper can have each own
section with its configuration.

The default path for the config file is /home//.config/ospd.conf

E.g. for ospd-openvas:

[OSPD - openvas]
unix_socket = /tmp/openvas.sock
log_level = DEBUG

All option have a default value. This option are overwritten if this
option is passed as command line argument.
If there is config file, is loaded and the option
listed in it will be set as the valid one, but they will be still
overwritten by the ones passed as cmd option.
This means that cmd options have priority over the other ones.

The config file must have a seccion with the wrapper name. As ospd
is a base lib for multiple wrappers, each wrapper can have each own
section with its configuration.

The default path for the config file is /home/<user>/.config/ospd.conf

E.g. for ospd-openvas:

``
[OSPD - openvas]
unix_socket = /tmp/openvas.sock
log_level = DEBUG
``
Copy link
Contributor

@bjoernricks bjoernricks left a comment

Choose a reason for hiding this comment

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

Looks good just some empty lines and an unused import.

ospd/parser.py Outdated Show resolved Hide resolved
ospd/parser.py Outdated Show resolved Hide resolved
ospd/parser.py Show resolved Hide resolved
tests/test_argument_parser.py Outdated Show resolved Hide resolved
jjnicola and others added 4 commits July 31, 2019 13:29
Co-Authored-By: Björn Ricks <bjoern.ricks@gmail.com>
Co-Authored-By: Björn Ricks <bjoern.ricks@gmail.com>
Co-Authored-By: Björn Ricks <bjoern.ricks@gmail.com>
Co-Authored-By: Björn Ricks <bjoern.ricks@gmail.com>
@codecov
Copy link

codecov bot commented Jul 31, 2019

Codecov Report

Merging #122 into master will decrease coverage by 0.02%.
The diff coverage is 72.97%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #122      +/-   ##
=========================================
- Coverage   69.72%   69.7%   -0.03%     
=========================================
  Files          11      12       +1     
  Lines        1612    1667      +55     
=========================================
+ Hits         1124    1162      +38     
- Misses        488     505      +17
Impacted Files Coverage Δ
ospd/main.py 0% <0%> (ø) ⬆️
ospd/config.py 63.15% <63.15%> (ø)
ospd/parser.py 85.71% <80.76%> (-14.29%) ⬇️

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 65f064b...1873eba. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Jul 31, 2019

Codecov Report

Merging #122 into master will decrease coverage by 0.02%.
The diff coverage is 72.97%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #122      +/-   ##
=========================================
- Coverage   69.72%   69.7%   -0.03%     
=========================================
  Files          11      12       +1     
  Lines        1612    1667      +55     
=========================================
+ Hits         1124    1162      +38     
- Misses        488     505      +17
Impacted Files Coverage Δ
ospd/main.py 0% <0%> (ø) ⬆️
ospd/config.py 63.15% <63.15%> (ø)
ospd/parser.py 85.71% <80.76%> (-14.29%) ⬇️

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 65f064b...1873eba. Read the comment docs.

@jjnicola jjnicola merged commit afcb140 into greenbone:master Jul 31, 2019
@jjnicola jjnicola deleted the file-parser branch July 31, 2019 11:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants