Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Paas CI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
INFN Cloud
Paas CI
Commits
0682511a
"git@baltig.infn.it:jgasparetto/ceph-webapp-poc.git" did not exist on "f9082223d77b09561c535820ae5533d13c4a1b53"
Commit
0682511a
authored
10 months ago
by
Gioacchino Vino
Browse files
Options
Downloads
Patches
Plain Diff
Reviewed code
parent
e253aed7
No related branches found
No related tags found
1 merge request
!143
Debug paas ci
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
files/gvm_library.py
+1
-36
1 addition, 36 deletions
files/gvm_library.py
files/scan.py
+4
-4
4 additions, 4 deletions
files/scan.py
with
5 additions
and
40 deletions
files/gvm_library.py
+
1
−
36
View file @
0682511a
...
...
@@ -521,39 +521,4 @@ class GVMClient():
def
get_version
(
self
)
->
str
:
res
=
self
.
client
.
get_version
()
return
str
(
res
.
xpath
(
'
version/text()
'
)[
0
])
def
delete_port_list
(
self
,
pl
:
PortList
):
res
=
self
.
client
.
delete_port_list
(
pl
.
id
)
status
=
res
.
xpath
(
GVM_XPATH_STATUS
)[
0
]
status_text
=
res
.
xpath
(
GVM_XPATH_STATUS_TEXT
)[
0
]
if
status
==
GVM_STATUS_OK
:
logging
.
info
(
f
"
Port_list
{
pl
}
DELETED
"
)
else
:
logging
.
error
(
f
"
ERROR
{
status
}
:
{
status_text
}
"
)
def
delete_target
(
self
,
target
:
Target
):
res
=
self
.
client
.
delete_target
(
target
.
id
)
status
=
res
.
xpath
(
GVM_XPATH_STATUS
)[
0
]
status_text
=
res
.
xpath
(
GVM_XPATH_STATUS_TEXT
)[
0
]
if
status
==
GVM_STATUS_OK
:
logging
.
info
(
f
"
Target
{
target
}
DELETED
"
)
else
:
logging
.
error
(
f
"
ERROR
{
status
}
:
{
status_text
}
"
)
def
search_and_delete_target
(
self
,
target_name
:
str
):
targets
=
self
.
get_targets
(
target_name
)
if
len
(
targets
)
==
1
:
self
.
delete_target
(
targets
[
0
][
'
id
'
])
else
:
raise
GvmException
(
"
Multiple results for search
"
)
def
search_and_delete_all_targets
(
self
,
target_name
:
str
):
targets
=
self
.
get_targets
(
target_name
)
for
target
in
targets
:
self
.
delete_target
(
target
)
def
delete_all_tasks
(
self
,
filter
:
str
):
tasks
=
self
.
get_tasks
(
filter
)
for
task
in
tasks
:
self
.
delete_task
(
task
)
\ No newline at end of file
return
str
(
res
.
xpath
(
'
version/text()
'
)[
0
])
\ No newline at end of file
This diff is collapsed.
Click to expand it.
files/scan.py
+
4
−
4
View file @
0682511a
...
...
@@ -96,19 +96,19 @@ for host,ports in endpoints.items():
summary_filename
=
f
"
{
output_dir
}
/summary-report.json
"
# Create PortList obj related to endpoint
port_list
=
PortList
(
client
=
gvm
.
get_
client
()
,
port_list
=
PortList
(
client
=
gvm
.
client
,
name
=
port_list_name
,
ports
=
ports
)
logging
.
info
(
f
"
Port list:
\n
{
port_list
}
"
)
# Create Target obj related to endpoint
target
=
Target
(
client
=
gvm
.
get_
client
()
,
target
=
Target
(
client
=
gvm
.
client
,
name
=
target_name
,
host
=
host
,
port_list
=
port_list
)
port_list
=
port_list
)
logging
.
info
(
f
"
Target:
\n
{
target
}
"
)
task
=
Task
(
client
=
gvm
.
get_
client
()
,
task
=
Task
(
client
=
gvm
.
client
,
name
=
task_name
,
target
=
target
)
logging
.
info
(
f
"
Task:
\n
{
task
}
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment