Refresh patches

This commit is contained in:
Garrett Holmstrom 2011-10-04 12:21:05 -07:00
parent 974de09f58
commit 1a48e763cf
9 changed files with 112 additions and 99 deletions

View File

@ -1,7 +1,33 @@
Index: cloud-init/setup.py Index: cloud-init-fedora/cloudinit/CloudConfig/cc_keys_to_console.py
=================================================================== ===================================================================
--- cloud-init.orig/setup.py --- cloud-init-fedora.orig/cloudinit/CloudConfig/cc_keys_to_console.py
+++ cloud-init/setup.py +++ cloud-init-fedora/cloudinit/CloudConfig/cc_keys_to_console.py
@@ -21,7 +21,7 @@ import subprocess
frequency = per_instance
def handle(name,cfg,cloud,log,args):
- write_ssh_prog='/usr/lib/cloud-init/write-ssh-key-fingerprints'
+ write_ssh_prog='/usr/libexec/cloud-init/write-ssh-key-fingerprints'
try:
confp = open('/dev/console',"wb")
subprocess.call(write_ssh_prog,stdout=confp)
Index: cloud-init-fedora/cloudinit/CloudConfig/cc_ssh.py
===================================================================
--- cloud-init-fedora.orig/cloudinit/CloudConfig/cc_ssh.py
+++ cloud-init-fedora/cloudinit/CloudConfig/cc_ssh.py
@@ -85,7 +85,7 @@ def handle(name,cfg,cloud,log,args):
send_ssh_keys_to_console()
def send_ssh_keys_to_console():
- subprocess.call(('/usr/lib/cloud-init/write-ssh-key-fingerprints',))
+ subprocess.call(('/usr/libexec/cloud-init/write-ssh-key-fingerprints',))
def apply_credentials(keys, user, disable_root, disable_root_opts=DISABLE_ROOT_OPTS, log=global_log):
keys = set(keys)
Index: cloud-init-fedora/setup.py
===================================================================
--- cloud-init-fedora.orig/setup.py
+++ cloud-init-fedora/setup.py
@@ -40,9 +40,8 @@ setup(name='cloud-init', @@ -40,9 +40,8 @@ setup(name='cloud-init',
data_files=[('/etc/cloud', glob('config/*.cfg')), data_files=[('/etc/cloud', glob('config/*.cfg')),
('/etc/cloud/cloud.cfg.d', glob('config/cloud.cfg.d/*')), ('/etc/cloud/cloud.cfg.d', glob('config/cloud.cfg.d/*')),
@ -13,29 +39,3 @@ Index: cloud-init/setup.py
['tools/uncloud-init', 'tools/write-ssh-key-fingerprints']), ['tools/uncloud-init', 'tools/write-ssh-key-fingerprints']),
('/usr/share/doc/cloud-init', filter(is_f,glob('doc/*'))), ('/usr/share/doc/cloud-init', filter(is_f,glob('doc/*'))),
('/usr/share/doc/cloud-init/examples', filter(is_f,glob('doc/examples/*'))), ('/usr/share/doc/cloud-init/examples', filter(is_f,glob('doc/examples/*'))),
Index: cloud-init/cloudinit/CloudConfig/cc_keys_to_console.py
===================================================================
--- cloud-init.orig/cloudinit/CloudConfig/cc_keys_to_console.py
+++ cloud-init/cloudinit/CloudConfig/cc_keys_to_console.py
@@ -21,7 +21,7 @@ import subprocess
frequency = per_instance
def handle(name,cfg,cloud,log,args):
- write_ssh_prog='/usr/lib/cloud-init/write-ssh-key-fingerprints'
+ write_ssh_prog='/usr/libexec/cloud-init/write-ssh-key-fingerprints'
try:
confp = open('/dev/console',"wb")
subprocess.call(write_ssh_prog,stdout=confp)
Index: cloud-init/cloudinit/CloudConfig/cc_ssh.py
===================================================================
--- cloud-init.orig/cloudinit/CloudConfig/cc_ssh.py
+++ cloud-init/cloudinit/CloudConfig/cc_ssh.py
@@ -85,7 +85,7 @@ def handle(name,cfg,cloud,log,args):
send_ssh_keys_to_console()
def send_ssh_keys_to_console():
- subprocess.call(('/usr/lib/cloud-init/write-ssh-key-fingerprints',))
+ subprocess.call(('/usr/libexec/cloud-init/write-ssh-key-fingerprints',))
def apply_credentials(keys, user, disable_root, disable_root_opts=DISABLE_ROOT_OPTS, log=global_log):
keys = set(keys)

View File

@ -1,7 +1,48 @@
Index: cloud-init/cloudinit/SshUtil.py Index: cloud-init-fedora/cloudinit/CloudConfig/cc_puppet.py
=================================================================== ===================================================================
--- cloud-init.orig/cloudinit/SshUtil.py --- cloud-init-fedora.orig/cloudinit/CloudConfig/cc_puppet.py
+++ cloud-init/cloudinit/SshUtil.py +++ cloud-init-fedora/cloudinit/CloudConfig/cc_puppet.py
@@ -22,6 +22,7 @@ import subprocess
import StringIO
import ConfigParser
import cloudinit.CloudConfig as cc
+import cloudinit.util as util
def handle(name,cfg,cloud,log,args):
# If there isn't a puppet key in the configuration don't do anything
@@ -58,6 +59,7 @@ def handle(name,cfg,cloud,log,args):
ca_fh.close()
os.chown('/var/lib/puppet/ssl/certs/ca.pem',
pwd.getpwnam('puppet').pw_uid, 0)
+ util.restorecon_if_possible('/var/lib/puppet', recursive=True)
else:
#puppet_conf_fh.write("\n[%s]\n" % (cfg_name))
# If puppet.conf already has this section we don't want to write it again
@@ -81,6 +83,7 @@ def handle(name,cfg,cloud,log,args):
os.rename('/etc/puppet/puppet.conf','/etc/puppet/puppet.conf.old')
with open('/etc/puppet/puppet.conf', 'wb') as configfile:
puppet_config.write(configfile)
+ util.restorecon_if_possible('/etc/puppet/puppet.conf')
# Set puppet default file to automatically start
subprocess.check_call(['sed', '-i',
'-e', 's/^START=.*/START=yes/',
Index: cloud-init-fedora/cloudinit/CloudConfig/cc_ssh.py
===================================================================
--- cloud-init-fedora.orig/cloudinit/CloudConfig/cc_ssh.py
+++ cloud-init-fedora/cloudinit/CloudConfig/cc_ssh.py
@@ -66,6 +66,8 @@ def handle(name,cfg,cloud,log,args):
genkeys+='ssh-keygen -f /etc/ssh/ssh_host_ecdsa_key -t ecdsa -N ""; '
subprocess.call(('sh', '-c', "{ %s } </dev/null" % (genkeys)))
+ util.restorecon_if_possible('/etc/ssh', recursive=True)
+
try:
user = util.get_cfg_option_str(cfg,'user')
disable_root = util.get_cfg_option_bool(cfg, "disable_root", True)
Index: cloud-init-fedora/cloudinit/SshUtil.py
===================================================================
--- cloud-init-fedora.orig/cloudinit/SshUtil.py
+++ cloud-init-fedora/cloudinit/SshUtil.py
@@ -147,6 +147,7 @@ def setup_user_keys(keys, user, key_pref @@ -147,6 +147,7 @@ def setup_user_keys(keys, user, key_pref
util.write_file(authorized_keys, content, 0600) util.write_file(authorized_keys, content, 0600)
@ -10,10 +51,10 @@ Index: cloud-init/cloudinit/SshUtil.py
os.umask(saved_umask) os.umask(saved_umask)
Index: cloud-init/cloudinit/util.py Index: cloud-init-fedora/cloudinit/util.py
=================================================================== ===================================================================
--- cloud-init.orig/cloudinit/util.py --- cloud-init-fedora.orig/cloudinit/util.py
+++ cloud-init/cloudinit/util.py +++ cloud-init-fedora/cloudinit/util.py
@@ -28,6 +28,12 @@ import time @@ -28,6 +28,12 @@ import time
import traceback import traceback
import re import re
@ -39,31 +80,3 @@ Index: cloud-init/cloudinit/util.py
# get keyid from keyserver # get keyid from keyserver
def getkeybyid(keyid,keyserver): def getkeybyid(keyid,keyserver):
Index: cloud-init/cloudinit/CloudConfig/cc_puppet.py
===================================================================
--- cloud-init.orig/cloudinit/CloudConfig/cc_puppet.py
+++ cloud-init/cloudinit/CloudConfig/cc_puppet.py
@@ -22,6 +22,7 @@ import subprocess
import StringIO
import ConfigParser
import cloudinit.CloudConfig as cc
+import cloudinit.util as util
def handle(name,cfg,cloud,log,args):
# If there isn't a puppet key in the configuration don't do anything
@@ -58,6 +59,7 @@ def handle(name,cfg,cloud,log,args):
ca_fh.close()
os.chown('/var/lib/puppet/ssl/certs/ca.pem',
pwd.getpwnam('puppet').pw_uid, 0)
+ util.restorecon_if_possible('/var/lib/puppet', recursive=True)
else:
#puppet_conf_fh.write("\n[%s]\n" % (cfg_name))
# If puppet.conf already has this section we don't want to write it again
@@ -81,6 +83,7 @@ def handle(name,cfg,cloud,log,args):
os.rename('/etc/puppet/puppet.conf','/etc/puppet/puppet.conf.old')
with open('/etc/puppet/puppet.conf', 'wb') as configfile:
puppet_config.write(configfile)
+ util.restorecon_if_possible('/etc/puppet/puppet.conf')
# Set puppet default file to automatically start
subprocess.check_call(['sed', '-i',
'-e', 's/^START=.*/START=yes/',

View File

@ -1,7 +1,7 @@
Index: cloud-init/cloudinit/CloudConfig/cc_locale.py Index: cloud-init-fedora/cloudinit/CloudConfig/cc_locale.py
=================================================================== ===================================================================
--- cloud-init.orig/cloudinit/CloudConfig/cc_locale.py --- cloud-init-fedora.orig/cloudinit/CloudConfig/cc_locale.py
+++ cloud-init/cloudinit/CloudConfig/cc_locale.py +++ cloud-init-fedora/cloudinit/CloudConfig/cc_locale.py
@@ -16,15 +16,17 @@ @@ -16,15 +16,17 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.

View File

@ -1,7 +1,7 @@
Index: cloud-init/cloudinit/CloudConfig/cc_puppet.py Index: cloud-init-fedora/cloudinit/CloudConfig/cc_puppet.py
=================================================================== ===================================================================
--- cloud-init.orig/cloudinit/CloudConfig/cc_puppet.py --- cloud-init-fedora.orig/cloudinit/CloudConfig/cc_puppet.py
+++ cloud-init/cloudinit/CloudConfig/cc_puppet.py +++ cloud-init-fedora/cloudinit/CloudConfig/cc_puppet.py
@@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.

View File

@ -1,7 +1,7 @@
Index: cloud-init/cloudinit/util.py Index: cloud-init-fedora/cloudinit/util.py
=================================================================== ===================================================================
--- cloud-init.orig/cloudinit/util.py --- cloud-init-fedora.orig/cloudinit/util.py
+++ cloud-init/cloudinit/util.py +++ cloud-init-fedora/cloudinit/util.py
@@ -145,7 +145,8 @@ def getkeybyid(keyid,keyserver): @@ -145,7 +145,8 @@ def getkeybyid(keyid,keyserver):
def runparts(dirp, skip_no_exist=True): def runparts(dirp, skip_no_exist=True):

View File

@ -1,7 +1,7 @@
Index: cloud-init/cloudinit/CloudConfig/cc_ssh.py Index: cloud-init-fedora/cloudinit/CloudConfig/cc_ssh.py
=================================================================== ===================================================================
--- cloud-init.orig/cloudinit/CloudConfig/cc_ssh.py --- cloud-init-fedora.orig/cloudinit/CloudConfig/cc_ssh.py
+++ cloud-init/cloudinit/CloudConfig/cc_ssh.py +++ cloud-init-fedora/cloudinit/CloudConfig/cc_ssh.py
@@ -31,7 +31,7 @@ def handle(name,cfg,cloud,log,args): @@ -31,7 +31,7 @@ def handle(name,cfg,cloud,log,args):
global_log = log global_log = log
@ -24,9 +24,9 @@ Index: cloud-init/cloudinit/CloudConfig/cc_ssh.py
+ subprocess.call(['ssh-keygen', '-t', keytype, '-N', '', + subprocess.call(['ssh-keygen', '-t', keytype, '-N', '',
+ '-f', '/etc/ssh/ssh_host_%s_key' % keytype]) + '-f', '/etc/ssh/ssh_host_%s_key' % keytype])
try: util.restorecon_if_possible('/etc/ssh', recursive=True)
user = util.get_cfg_option_str(cfg,'user')
@@ -82,11 +82,6 @@ def handle(name,cfg,cloud,log,args): @@ -84,11 +84,6 @@ def handle(name,cfg,cloud,log,args):
util.logexc(log) util.logexc(log)
log.warn("applying credentials failed!\n") log.warn("applying credentials failed!\n")
@ -38,10 +38,10 @@ Index: cloud-init/cloudinit/CloudConfig/cc_ssh.py
def apply_credentials(keys, user, disable_root, disable_root_opts=DISABLE_ROOT_OPTS, log=global_log): def apply_credentials(keys, user, disable_root, disable_root_opts=DISABLE_ROOT_OPTS, log=global_log):
keys = set(keys) keys = set(keys)
if user: if user:
Index: cloud-init/cloudinit/util.py Index: cloud-init-fedora/cloudinit/util.py
=================================================================== ===================================================================
--- cloud-init.orig/cloudinit/util.py --- cloud-init-fedora.orig/cloudinit/util.py
+++ cloud-init/cloudinit/util.py +++ cloud-init-fedora/cloudinit/util.py
@@ -84,6 +84,7 @@ def get_cfg_option_str(yobj, key, defaul @@ -84,6 +84,7 @@ def get_cfg_option_str(yobj, key, defaul
def get_cfg_option_list_or_str(yobj, key, default=None): def get_cfg_option_list_or_str(yobj, key, default=None):
@ -50,10 +50,10 @@ Index: cloud-init/cloudinit/util.py
if isinstance(yobj[key],list): return yobj[key] if isinstance(yobj[key],list): return yobj[key]
return([yobj[key]]) return([yobj[key]])
Index: cloud-init/tools/write-ssh-key-fingerprints Index: cloud-init-fedora/tools/write-ssh-key-fingerprints
=================================================================== ===================================================================
--- cloud-init.orig/tools/write-ssh-key-fingerprints --- cloud-init-fedora.orig/tools/write-ssh-key-fingerprints
+++ cloud-init/tools/write-ssh-key-fingerprints +++ cloud-init-fedora/tools/write-ssh-key-fingerprints
@@ -3,8 +3,7 @@ @@ -3,8 +3,7 @@
echo echo
echo "#############################################################" echo "#############################################################"

View File

@ -40,5 +40,5 @@ Index: cloud-init-fedora/cloudinit/CloudConfig/cc_ssh.py
+ subprocess.call(['ssh-keygen', '-t', keytype, '-N', '', + subprocess.call(['ssh-keygen', '-t', keytype, '-N', '',
+ '-f', keyfile]) + '-f', keyfile])
try: util.restorecon_if_possible('/etc/ssh', recursive=True)
user = util.get_cfg_option_str(cfg,'user')

View File

@ -1,7 +1,7 @@
Index: cloud-init/systemd/cloud-config.service Index: cloud-init-fedora/systemd/cloud-config.service
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ cloud-init/systemd/cloud-config.service +++ cloud-init-fedora/systemd/cloud-config.service
@@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
+[Unit] +[Unit]
+Description=Apply the settings specified in cloud-config +Description=Apply the settings specified in cloud-config
@ -16,10 +16,10 @@ Index: cloud-init/systemd/cloud-config.service
+ +
+[Install] +[Install]
+WantedBy=multi-user.target +WantedBy=multi-user.target
Index: cloud-init/systemd/cloud-config.target Index: cloud-init-fedora/systemd/cloud-config.target
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ cloud-init/systemd/cloud-config.target +++ cloud-init-fedora/systemd/cloud-config.target
@@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
+# cloud-init normally emits a "cloud-config" upstart event to inform third +# cloud-init normally emits a "cloud-config" upstart event to inform third
+# parties that cloud-config is available, which does us no good when we're +# parties that cloud-config is available, which does us no good when we're
@ -31,10 +31,10 @@ Index: cloud-init/systemd/cloud-config.target
+[Unit] +[Unit]
+Description=Cloud-config availability +Description=Cloud-config availability
+Requires=cloud-init-local.service cloud-init.service +Requires=cloud-init-local.service cloud-init.service
Index: cloud-init/systemd/cloud-final.service Index: cloud-init-fedora/systemd/cloud-final.service
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ cloud-init/systemd/cloud-final.service +++ cloud-init-fedora/systemd/cloud-final.service
@@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
+[Unit] +[Unit]
+Description=Execute cloud user/final scripts +Description=Execute cloud user/final scripts
@ -49,10 +49,10 @@ Index: cloud-init/systemd/cloud-final.service
+ +
+[Install] +[Install]
+WantedBy=multi-user.target +WantedBy=multi-user.target
Index: cloud-init/systemd/cloud-init-local.service Index: cloud-init-fedora/systemd/cloud-init-local.service
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ cloud-init/systemd/cloud-init-local.service +++ cloud-init-fedora/systemd/cloud-init-local.service
@@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
+[Unit] +[Unit]
+Description=Initial cloud-init job (pre-networking) +Description=Initial cloud-init job (pre-networking)
@ -66,10 +66,10 @@ Index: cloud-init/systemd/cloud-init-local.service
+ +
+[Install] +[Install]
+WantedBy=multi-user.target +WantedBy=multi-user.target
Index: cloud-init/systemd/cloud-init.service Index: cloud-init-fedora/systemd/cloud-init.service
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ cloud-init/systemd/cloud-init.service +++ cloud-init-fedora/systemd/cloud-init.service
@@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
+[Unit] +[Unit]
+Description=Initial cloud-init job (metadata service crawler) +Description=Initial cloud-init job (metadata service crawler)

View File

@ -1,7 +1,7 @@
Index: cloud-init/cloudinit/CloudConfig/cc_timezone.py Index: cloud-init-fedora/cloudinit/CloudConfig/cc_timezone.py
=================================================================== ===================================================================
--- cloud-init.orig/cloudinit/CloudConfig/cc_timezone.py --- cloud-init-fedora.orig/cloudinit/CloudConfig/cc_timezone.py
+++ cloud-init/cloudinit/CloudConfig/cc_timezone.py +++ cloud-init-fedora/cloudinit/CloudConfig/cc_timezone.py
@@ -45,6 +45,13 @@ def handle(name,cfg,cloud,log,args): @@ -45,6 +45,13 @@ def handle(name,cfg,cloud,log,args):
except: except:
log.debug("failed to write to /etc/timezone") log.debug("failed to write to /etc/timezone")