Merge "Add comments to injected keys and network config"

This commit is contained in:
Jenkins 2012-02-02 23:06:19 +00:00 committed by Gerrit Code Review
commit 38399a7333
2 changed files with 10 additions and 1 deletions

View File

@ -294,8 +294,15 @@ def _inject_key_into_fs(key, fs, execute=None):
utils.execute('chown', 'root', sshdir, run_as_root=True)
utils.execute('chmod', '700', sshdir, run_as_root=True)
keyfile = os.path.join(sshdir, 'authorized_keys')
key_data = [
'\n',
'# The following ssh key was injected by Nova',
'\n',
key.strip(),
'\n',
]
utils.execute('tee', '-a', keyfile,
process_input='\n' + key.strip() + '\n', run_as_root=True)
process_input=''.join(key_data), run_as_root=True)
def _inject_net_into_fs(net, fs, execute=None):

View File

@ -1,3 +1,5 @@
# Injected by Nova on instance boot
#
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).