mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 18:00:35 +00:00
Fix a couple of (presumed) issues with regex escaping.
In each of these cases we have an un-escaped \n or \t that gets passed to a regex. That means that the regexes actually contain tabs or newlines, respectively. After this change an actual '\t' and '\n' are passed in instead. I have not tested this! I am writing this patch based on the assumption that /surely/ the original authors meant to pass in \t and \n to the regex and not actual tab or newline characters.
This commit is contained in:
parent
24ac85802d
commit
a5e8aae7b0
2 changed files with 2 additions and 2 deletions
|
@ -147,7 +147,7 @@ class ApplyPuppetManifest(Task):
|
||||||
log_check_call(['chroot', info.root, 'puppet', 'apply', '--verbose', '--debug', manifest_path])
|
log_check_call(['chroot', info.root, 'puppet', 'apply', '--verbose', '--debug', manifest_path])
|
||||||
os.remove(manifest_dst)
|
os.remove(manifest_dst)
|
||||||
hosts_path = os.path.join(info.root, 'etc/hosts')
|
hosts_path = os.path.join(info.root, 'etc/hosts')
|
||||||
sed_i(hosts_path, '127.0.0.1\\s*{hostname}\n?'.format(hostname=hostname), '')
|
sed_i(hosts_path, r'127.0.0.1\s*{hostname}\n?'.format(hostname=hostname), '')
|
||||||
|
|
||||||
|
|
||||||
class EnableAgent(Task):
|
class EnableAgent(Task):
|
||||||
|
|
|
@ -53,7 +53,7 @@ class CreatePVGrubCustomRule(Task):
|
||||||
grub_device = 'GRUB_DEVICE=/dev/xvda' + str(root_idx)
|
grub_device = 'GRUB_DEVICE=/dev/xvda' + str(root_idx)
|
||||||
sed_i(script_dst, '^GRUB_DEVICE=/dev/xvda$', grub_device)
|
sed_i(script_dst, '^GRUB_DEVICE=/dev/xvda$', grub_device)
|
||||||
grub_root = '\troot (hd0,{idx})'.format(idx=root_idx - 1)
|
grub_root = '\troot (hd0,{idx})'.format(idx=root_idx - 1)
|
||||||
sed_i(script_dst, '^\troot \\(hd0\\)$', grub_root)
|
sed_i(script_dst, r'^\troot \(hd0\)$', grub_root)
|
||||||
|
|
||||||
if info.manifest.volume['backing'] == 's3':
|
if info.manifest.volume['backing'] == 's3':
|
||||||
from bootstrapvz.common.tools import sed_i
|
from bootstrapvz.common.tools import sed_i
|
||||||
|
|
Loading…
Add table
Reference in a new issue