Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor 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
mediaserver
envsetup
Commits
aba671a0
Commit
aba671a0
authored
5 years ago
by
Nicolas KAROLAK
Browse files
Options
Downloads
Patches
Plain Diff
set envvar for apt
parent
444e5cff
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/test_apt.py
+4
-0
4 additions, 0 deletions
tests/test_apt.py
utils_lib/apt.py
+4
-0
4 additions, 0 deletions
utils_lib/apt.py
with
8 additions
and
0 deletions
tests/test_apt.py
+
4
−
0
View file @
aba671a0
...
...
@@ -6,6 +6,7 @@ Check updates, apt state and unattended upgrade config.
"""
import
apt_pkg
import
os
from
pathlib
import
Path
import
requests
import
sys
...
...
@@ -27,6 +28,9 @@ from utils_lib.os import line_in_file # noqa: E402
def
main
():
warnings
=
0
errors
=
0
os
.
environ
[
"
DEBIAN_FRONTEND
"
]
=
"
noninteractive
"
os
.
environ
[
"
PATH
"
]
=
"
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
"
apt
=
Apt
(
update
=
True
)
print
(
"
Checking APT state:
"
)
...
...
This diff is collapsed.
Click to expand it.
utils_lib/apt.py
+
4
−
0
View file @
aba671a0
...
...
@@ -4,6 +4,8 @@
A wrapper of apt module that is actually usable.
"""
import
os
import
utils
as
u
try
:
...
...
@@ -24,6 +26,8 @@ class Apt:
# upgradable_packages: list
def
__init__
(
self
,
update
:
bool
=
False
):
os
.
environ
[
"
DEBIAN_FRONTEND
"
]
=
"
noninteractive
"
os
.
environ
[
"
PATH
"
]
=
"
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
"
self
.
cache
=
self
.
get_cache
(
update
)
self
.
packages
=
self
.
get_packages
()
self
.
_installed_packages
=
self
.
get_installed_packages
()
...
...
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