Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Image CI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
linuxsupport
Testing
Image CI
Merge requests
!20
Remove RHEL landb logic, it's no longer needed
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Remove RHEL landb logic, it's no longer needed
rmrhellandb
into
master
Overview
2
Commits
2
Pipelines
0
Changes
4
Merged
Ben Morrice
requested to merge
rmrhellandb
into
master
3 years ago
Overview
2
Commits
2
Pipelines
0
Changes
4
Expand
0
0
Merge request reports
Compare
master
version 2
6690c120
3 years ago
version 1
f8ffc29b
3 years ago
master (base)
and
latest version
latest version
6690c120
2 commits,
3 years ago
version 2
6690c120
2 commits,
3 years ago
version 1
f8ffc29b
1 commit,
3 years ago
4 files
+
0
−
149
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
rh_helper_scripts/landbexistence.py deleted
100755 → 0
+
0
−
70
Options
#!/usr/bin/python3
# Example of using the Python SUDS library to access the LANDB SOAP interface
# In Python 3, the suds-jurko port can be used: https://bitbucket.org/jurko/suds
import
os
import
sys
import
logging
import
argparse
import
time
from
suds.client
import
Client
from
suds.sax.element
import
Element
from
suds.xsd.doctor
import
ImportDoctor
,
Import
from
pprint
import
pprint
# Client setup
url
=
'
https://network.cern.ch/sc/soap/soap.fcgi?v=6&WSDL
'
imp
=
Import
(
'
http://schemas.xmlsoap.org/soap/encoding/
'
)
doc
=
ImportDoctor
(
imp
)
client
=
Client
(
url
,
doctor
=
doc
,
cache
=
None
)
# Force logger to print through stderr and add default format to messages
logger
=
logging
.
getLogger
()
logger
.
setLevel
(
logging
.
DEBUG
)
ch
=
logging
.
StreamHandler
(
sys
.
stderr
)
ch
.
setLevel
(
logging
.
INFO
)
formatter
=
logging
.
Formatter
(
'
%(asctime)s - %(levelname)s - %(message)s
'
)
ch
.
setFormatter
(
formatter
)
logger
.
addHandler
(
ch
)
# Get hostname
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'
-hn
'
,
'
--host_name
'
,
required
=
True
)
args
=
parser
.
parse_args
()
# Authentication
USERNAME
=
os
.
environ
[
'
IMAGECI_USER
'
]
PASSWORD
=
os
.
environ
[
'
IMAGECI_PWD
'
]
TEST_NODE_NAME
=
args
.
host_name
# Max number of tries against LANDB
max_num_try
=
20
token
=
client
.
service
.
getAuthToken
(
USERNAME
,
PASSWORD
,
'
CERN
'
)
authenticationHeader
=
Element
(
'
Auth
'
).
insert
(
Element
(
'
token
'
).
setText
(
token
))
client
.
set_options
(
soapheaders
=
authenticationHeader
)
success
=
False
num_try
=
0
while
success
is
False
:
if
num_try
>=
max_num_try
:
logging
.
error
(
"
Device could not be found in LANDB after %d tries.
"
%
max_num_try
)
sys
.
exit
(
1
)
try
:
criteria
=
client
.
factory
.
create
(
"
types:DeviceSearch
"
)
criteria
.
Name
=
TEST_NODE_NAME
# Yes, this Location is mandatory, otherwise you get 'INVPATTERN#Invalid search pattern:-BADLOCATION'
criteria
.
Location
=
None
result
=
client
.
service
.
searchDevice
(
criteria
)
if
result
:
success
=
True
else
:
# List is empty
num_try
+=
1
# Wait 30 sec before trying again
time
.
sleep
(
30
)
except
Exception
as
e
:
num_try
+=
1
# Wait 30 sec before trying again
time
.
sleep
(
30
)
logging
.
info
(
'
Node is present in LANDB, continue with tests.
'
)
\ No newline at end of file
Loading