From 914822a765007be7e17539e456b3e6ff12b19442 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Wed, 7 Jun 2017 11:32:56 -0400 Subject: rhel/centos spec cleanups. Many changes here to get us able to build rpms on CentOS 5 or 6 and RHEL. * add 'Requires' as 'BuildRequires' also. This allows us to run cloud-init tools in the build environment, and also will allow us to run tests in the build process. * build for both systemd and upstart (centos 5) init systems. * Add 'centos' as a variant Adding the variant means we can use the 'centos' user as default on centos rather than a 'fedora' or 'rhel'. * drop argparse from the requirements. On any system other than python 2.6, having a 'requirements' that mentions argparse just causes problems. Instead we add that Requires to the spec directly. * list dependency on dmidecode (as redhat distro spec had) * remove duplicate line in files section ({_unitdir}/cloud-*) * Use rpm macros for init-system chunks and drop use of init_system variable template * Add el6 only build-req on python-argparse * python-cheetah is not required in the build environment as the the spec is already rendered. (We will soon move the spec to jinja). --- cloudinit/distros/__init__.py | 2 +- cloudinit/distros/centos.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 cloudinit/distros/centos.py (limited to 'cloudinit/distros') diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py index f56c0cf7..1fd48a7b 100755 --- a/cloudinit/distros/__init__.py +++ b/cloudinit/distros/__init__.py @@ -32,7 +32,7 @@ from cloudinit.distros.parsers import hosts OSFAMILIES = { 'debian': ['debian', 'ubuntu'], - 'redhat': ['fedora', 'rhel'], + 'redhat': ['centos', 'fedora', 'rhel'], 'gentoo': ['gentoo'], 'freebsd': ['freebsd'], 'suse': ['sles'], diff --git a/cloudinit/distros/centos.py b/cloudinit/distros/centos.py new file mode 100644 index 00000000..4b803d2e --- /dev/null +++ b/cloudinit/distros/centos.py @@ -0,0 +1,12 @@ +# This file is part of cloud-init. See LICENSE file for license information. + +from cloudinit.distros import rhel +from cloudinit import log as logging + +LOG = logging.getLogger(__name__) + + +class Distro(rhel.Distro): + pass + +# vi: ts=4 expandtab -- cgit v1.2.3