Rebase against version 0.7.1

This commit is contained in:
Garrett Holmstrom 2012-11-21 13:44:08 -08:00
parent a851231a0c
commit e8a08074fe
3 changed files with 6 additions and 62 deletions

View File

@ -1,56 +0,0 @@
Index: trunk/cloudinit/distros/fedora.py
===================================================================
--- trunk.orig/cloudinit/distros/fedora.py
+++ trunk/cloudinit/distros/fedora.py
@@ -23,9 +23,23 @@
from cloudinit.distros import rhel
from cloudinit import log as logging
+from cloudinit import util
LOG = logging.getLogger(__name__)
class Distro(rhel.Distro):
default_user = 'ec2-user'
+
+ def set_hostname(self, hostname):
+ # sysconfig-based (inherited from rhel.Distro)
+ sysconfig_fname = self._paths.join(False, '/etc/sysconfig/network')
+ self._write_hostname(hostname, '/etc/sysconfig/network')
+ # systemd-based
+ etc_fname = self._paths.join(False, '/etc/hostname')
+ util.write_file(etc_fname, str(hostname) + '\n', 0644)
+
+ if sysconfig_fname == '/etc/sysconfig/network':
+ # Only do this if we are running in non-adjusted root mode
+ LOG.debug('Setting hostname to %s', hostname)
+ util.subp(['hostname', hostname])
Index: trunk/templates/hosts.fedora.tmpl
===================================================================
--- /dev/null
+++ trunk/templates/hosts.fedora.tmpl
@@ -0,0 +1,23 @@
+#*
+ This file /etc/cloud/templates/hosts.fedora.tmpl is only utilized
+ if enabled in cloud-config. Specifically, in order to enable it
+ you need to add the following to config:
+ manage_etc_hosts: True
+*#
+# Your system has configured 'manage_etc_hosts' as True.
+# As a result, if you wish for changes to this file to persist
+# then you will need to either
+# a.) make changes to the master file in /etc/cloud/templates/hosts.fedora.tmpl
+# b.) change or remove the value of 'manage_etc_hosts' in
+# /etc/cloud/cloud.cfg or cloud-config from user-data
+#
+# The following lines are desirable for IPv4 capable hosts
+127.0.0.1 ${fqdn} ${hostname}
+127.0.0.1 localhost.localdomain localhost
+127.0.0.1 localhost4.localdomain4 localhost4
+
+# The following lines are desirable for IPv6 capable hosts
+::1 ${fqdn} ${hostname}
+::1 localhost.localdomain localhost
+::1 localhost6.localdomain6 localhost6
+

View File

@ -1,19 +1,17 @@
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
Name: cloud-init
Version: 0.7.0
Version: 0.7.1
Release: 1%{?dist}
Summary: Cloud instance init scripts
Group: System Environment/Base
License: GPLv3
URL: http://launchpad.net/cloud-init
Source0: https://launchpad.net/cloud-init/trunk/0.7.0/+download/cloud-init-0.7.0.tar.gz
Source0: https://launchpad.net/cloud-init/trunk/0.7.1/+download/cloud-init-0.7.1.tar.gz
Source1: cloud-init-fedora.cfg
Source2: cloud-init-README.fedora
Patch0: cloud-init-0.7.0-fedora.patch
# Make Fedora update both /etc/hostname and /etc/sysconfig/network
Patch1: cloud-init-0.7.0-fedora-hostname.patch
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -50,7 +48,6 @@ ssh keys and to let the user run various scripts.
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1
cp -p %{SOURCE2} README.fedora
@ -128,6 +125,9 @@ fi
%changelog
* Wed Nov 21 2012 Garrett Holmstrom <gholms@fedoraproject.org> - 0.7.1-1
- Rebased against version 0.7.1
* Tue Oct 9 2012 Garrett Holmstrom <gholms@fedoraproject.org> - 0.7.0-1
- Rebased against version 0.7.0
- Fixed / filesystem resizing

View File

@ -1 +1 @@
1b18e8dfd8789473d9f66cd87cc64a50 cloud-init-0.7.0.tar.gz
40d5c5279389ba74563ee5168c05c139 cloud-init-0.7.1.tar.gz