Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cern-anaconda-addon
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
Container Registry
Model registry
Operate
Environments
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
rpms
cern-anaconda-addon
Commits
de1c2cfa
Commit
de1c2cfa
authored
4 years ago
by
Ben Morrice
Browse files
Options
Downloads
Patches
Plain Diff
use dnf-automatic on 8 family systems
parent
66f428c2
No related branches found
No related tags found
1 merge request
!1
use dnf-automatic on 8 family systems
Pipeline
#2416351
passed
4 years ago
Stage: srpm
Stage: rpm
Stage: lint
Stage: koji_scratch
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cern-anaconda-addon.spec
+4
-1
4 additions, 1 deletion
cern-anaconda-addon.spec
src/cern_customizations/ks/cern.py
+26
-17
26 additions, 17 deletions
src/cern_customizations/ks/cern.py
with
30 additions
and
18 deletions
cern-anaconda-addon.spec
+
4
−
1
View file @
de1c2cfa
Name: cern-anaconda-addon
Version: 1.
7
Version: 1.
8
Release: 1%{?dist}
Summary: CERN configuration anaconda addon
...
...
@@ -31,6 +31,9 @@ install -p -m 644 data/cern.svg %{buildroot}/%{_datadir}/icons/hicolor/scalable/
%doc LICENSE README.md
%changelog
* Thu Mar 18 2021 Ben Morrice <ben.morrice@cern.ch> - 1.8-1
- Use dnf-automatic instead of yum-autoupdate on 8 family systems
* Tue Jan 28 2020 Ben Morrice <ben.morrice@cern.ch> - 1.7-1
- Add support for C8
...
...
This diff is collapsed.
Click to expand it.
src/cern_customizations/ks/cern.py
+
26
−
17
View file @
de1c2cfa
...
...
@@ -238,31 +238,40 @@ class CernData(AddonData):
except
NoOptionError
:
print
(
"
Unexpected error:
"
,
sys
.
exc_info
()[
0
])
# we will need this for later
release
=
open
(
'
/etc/redhat-release
'
,
'
r
'
).
read
().
split
(
'
'
)[
3
].
split
(
'
.
'
)[
0
]
# Configure yum-autoupdate
if
self
.
autoupdate
:
yumautoupdate_installed
=
os
.
path
.
isfile
(
'
/usr/sbin/yum-autoupdate
'
)
if
yumautoupdate_installed
==
False
:
# 'yum' will work for both 7 and 8
subprocess
.
check_call
([
"
yum
"
,
"
-y
"
,
"
install
"
,
"
yum-autoupdate
"
])
subprocess
.
check_call
([
SYSTEMCTL_BIN
,
"
enable
"
,
"
yum-autoupdate
"
])
try
:
with
open
(
yumupdate_file
,
"
a
"
)
as
fobj
:
fobj
.
write
(
"
\n
# initial-setup [cern-anaconda-cern] values
\n
"
)
fobj
.
write
(
"
YUMUPDATE=%d
\n
"
%
int
(
self
.
autoupdate
))
fobj
.
write
(
"
YUMONBOOT=%d
\n
"
%
int
(
self
.
autoupdateboot
))
fobj
.
close
()
except
IOError
:
print
(
"
I/O Error couldn
'
t write %s
"
%
(
yumupdate_file
))
except
:
print
(
"
Unexpected error:
"
,
sys
.
exc_info
()[
0
])
if
release
==
'
8
'
:
# install dnf-automatic instead of custom yum-autoupdate
subprocess
.
check_call
([
"
dnf
"
,
"
-y
"
,
"
install
"
,
"
dnf-automatic
"
])
subprocess
.
check_call
([
SYSTEMCTL_BIN
,
"
enable
"
,
"
--now
"
,
"
dnf-automatic-install.timer
"
])
else
:
yumautoupdate_installed
=
os
.
path
.
isfile
(
'
/usr/sbin/yum-autoupdate
'
)
if
yumautoupdate_installed
==
False
:
subprocess
.
check_call
([
"
yum
"
,
"
-y
"
,
"
install
"
,
"
yum-autoupdate
"
])
subprocess
.
check_call
([
SYSTEMCTL_BIN
,
"
enable
"
,
"
yum-autoupdate
"
])
try
:
with
open
(
yumupdate_file
,
"
a
"
)
as
fobj
:
fobj
.
write
(
"
\n
# initial-setup [cern-anaconda-cern] values
\n
"
)
fobj
.
write
(
"
YUMUPDATE=%d
\n
"
%
int
(
self
.
autoupdate
))
fobj
.
write
(
"
YUMONBOOT=%d
\n
"
%
int
(
self
.
autoupdateboot
))
fobj
.
close
()
except
IOError
:
print
(
"
I/O Error couldn
'
t write %s
"
%
(
yumupdate_file
))
except
:
print
(
"
Unexpected error:
"
,
sys
.
exc_info
()[
0
])
else
:
# we use call rather than check_call as we don't care if this fails
# due to yumautoupdate not being installed
subprocess
.
call
([
SYSTEMCTL_BIN
,
"
disable
"
,
"
yum-autoupdate
"
])
if
release
==
'
8
'
:
subprocess
.
call
([
SYSTEMCTL_BIN
,
"
disable
"
,
"
yum-autoupdate
"
])
else
:
subprocess
.
call
([
SYSTEMCTL_BIN
,
"
disable
"
,
"
dnf-automatic-install.timer
"
])
# locmap may not be installed - force install if it's not
locmap_installed
=
os
.
path
.
isfile
(
'
/usr/bin/locmap
'
)
release
=
open
(
'
/etc/redhat-release
'
,
'
r
'
).
read
().
split
(
'
'
)[
3
].
split
(
'
.
'
)[
0
]
if
locmap_installed
==
False
:
# locmap does not reside in CERN repo on 8, install locmap-release
if
release
==
'
8
'
:
...
...
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