UNCLASSIFIED
Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Ironbank Tools
administration-tools
Commits
8830dbbf
You need to sign in or sign up before continuing.
Commit
8830dbbf
authored
Apr 20, 2021
by
Tim Seagren
Browse files
reorganzizing
parent
85417450
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
0 deletions
+48
-0
gitlab-user-offboarding/README.md
gitlab-user-offboarding/README.md
+0
-0
gitlab-user-offboarding/sanitize_gitlab_user.py
gitlab-user-offboarding/sanitize_gitlab_user.py
+0
-0
harbor-user-offboarding/sanitize_harbor_user.py
harbor-user-offboarding/sanitize_harbor_user.py
+48
-0
No files found.
purge-
gitlab-user/README.md
→
gitlab-user
-offboarding
/README.md
View file @
8830dbbf
File moved
purge-
gitlab-user
/user_purge
.py
→
gitlab-user
-offboarding/sanitize_gitlab_user
.py
View file @
8830dbbf
File moved
harbor-user-offboarding/sanitize_harbor_user.py
0 → 100755
View file @
8830dbbf
#!/usr/bin/python3
import
argparse
import
sys
import
requests
import
json
import
os
import
logging
from
requests.auth
import
HTTPBasicAuth
def
_cache_rpm_repo
(
sync_type
,
group
,
src_repo
,
dest_repo
,
proxies
):
_create_repo
(
sync_type
,
group
,
dest_repo
,
src_repo
,
proxies
)
package_repo
=
repomd
.
load
(
src_repo
)
logs
.
info
(
package_repo
)
for
package
in
package_repo
:
logs
.
info
(
f
"getting package
{
dest_repo
}{
package
.
location
}
"
)
r
=
requests
.
head
(
f
"
{
dest_repo
}{
package
.
location
}
"
,
proxies
=
proxies
)
def
main
():
parser
=
argparse
.
ArgumentParser
(
description
=
'Cache RPM and Debian packages in Nexus'
)
parser
.
add_argument
(
'repo_file'
,
help
=
"Run on a single repo"
,
default
=
"repo_file.json"
)
parser
.
add_argument
(
'--proxy'
,
help
=
"Add proxy for staging"
,
default
=
{})
args
=
parser
.
parse_args
()
proxies
=
args
.
proxy
if
args
.
proxy
:
proxies
=
{
'http'
:
f
'
{
args
.
proxy
}
'
,
'https'
:
f
'
{
args
.
proxy
}
'
,
}
if
__name__
==
"__main__"
:
logs
=
logging
.
getLogger
(
"mirror"
)
# Get logging level, set manually when running pipeline
loglevel
=
os
.
environ
.
get
(
"LOGLEVEL"
,
"INFO"
).
upper
()
if
loglevel
==
"DEBUG"
:
logging
.
basicConfig
(
level
=
loglevel
,
filename
=
"mirror_log.out"
,
format
=
"%(levelname)s [%(filename)s:%(lineno)d]: %(message)s"
,
)
logging
.
debug
(
"Log level set to debug"
)
else
:
logging
.
basicConfig
(
level
=
loglevel
,
format
=
"%(levelname)s: %(message)s"
)
logging
.
info
(
"Log level set to info"
)
sys
.
exit
(
main
())
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment