Skip to content

Commit

Permalink
Merge pull request cobbler#1626 from jmaas/master
Browse files Browse the repository at this point in the history
Improve handling of yum-utils and dnf cases.
  • Loading branch information
jmaas committed Jan 23, 2016
2 parents 6ffb585 + 3980e51 commit 8cde89f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
9 changes: 8 additions & 1 deletion cobbler.spec
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,16 @@ Requires: python-simplejson
Requires: python-urlgrabber
Requires: rsync
Requires: syslinux
Requires: yum-utils
Requires: logrotate

%if 0%{?fedora} < 23 || 0%{?rhel} >= 7
Requires: yum-utils
%endif

%if 0%{?fedora} >= 23
Requires: dnf-core-plugins
%endif

%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
BuildRequires: redhat-rpm-config
BuildRequires: systemd-units
Expand Down
28 changes: 18 additions & 10 deletions cobbler/action_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,18 @@ def check_yum(self, status):

if not os.path.exists("/usr/bin/createrepo"):
status.append(_("createrepo package is not installed, needed for cobbler import and cobbler reposync, install createrepo?"))

if not os.path.exists("/usr/bin/dnf") and not os.path.exists("/usr/bin/reposync"):
status.append(_("reposync is not installed, need for cobbler reposync, install/upgrade yum-utils?"))
if not os.path.exists("/usr/bin/yumdownloader"):
status.append(_("yumdownloader is not installed, needed for cobbler repo add with --rpm-list parameter, install/upgrade yum-utils?"))
if self.settings.reposync_flags.find("-l"):
if self.checked_family in ("redhat", "suse"):
yum_utils_ver = utils.subprocess_get(self.logger, "/usr/bin/rpmquery --queryformat=%{VERSION} yum-utils", shell=True)
if yum_utils_ver < "1.1.17":
status.append(_("yum-utils need to be at least version 1.1.17 for reposync -l, current version is %s") % yum_utils_ver)
status.append(_("reposync not installed, install yum-utils"))

if os.path.exists("/usr/bin/dnf") and not os.path.exists("/usr/bin/reposync"):
status.append(_("reposync is not installed, install yum-utils or dnf-plugins-core"))

if not os.path.exists("/usr/bin/dnf") and not os.path.exists("/usr/bin/yumdownloader"):
status.append(_("yumdownloader is not installed, install yum-utils"))

if os.path.exists("/usr/bin/dnf") and not os.path.exists("/usr/bin/yumdownloader"):
status.append(_("yumdownloader is not installed, install yum-utils or dnf-plugins-core"))

def check_debmirror(self, status):
if not os.path.exists("/usr/bin/debmirror"):
Expand Down Expand Up @@ -400,8 +403,13 @@ def check_rsync_conf(self, status):
for line in f.readlines():
if re_disable.search(line) and not line.strip().startswith("#"):
status.append(_("change 'disable' to 'no' in %(file)s") % {"file": "/etc/xinetd.d/rsync"})
else:
status.append(_("file %(file)s does not exist") % {"file": "/etc/xinetd.d/rsync"})

if os.path.exists("/usr/lib/systemd/system/rsyncd.service"):
if not os.path.exists("/etc/systemd/system/multi-user.target.wants/rsyncd.service"):
status.append(_("enable and start rsyncd.service with systemctl"))

if not os.path.exists("/usr/lib/systemd") and os.path.exists("/etc/xinetd.d"):
status.append(_("file /etc/xinetd.d/rsync does not exist"))

def check_dhcpd_conf(self, status):
"""
Expand Down

0 comments on commit 8cde89f

Please sign in to comment.