Commit 6894b3c2 authored by Marco Mariani's avatar Marco Mariani

resource_stream -> resource_string

parent 4a7af070
......@@ -237,8 +237,8 @@ def slapserver(config):
print "Creating %r" % host_path
if not dry_run:
open(host_path, 'w').write(
pkg_resources.resource_stream(__name__,
'template/hosts.in').read() % {
pkg_resources.resource_string(__name__,
'template/hosts.in') % {
'computer_id': config.computer_id
})
......@@ -247,8 +247,8 @@ def slapserver(config):
print "Creating %r" % sshd_path
if not dry_run:
open(sshd_path, 'w').write(
pkg_resources.resource_stream(__name__,
'template/sshd_config.in').read())
pkg_resources.resource_string(__name__,
'template/sshd_config.in'))
os.chmod(sshd_path, 0o600)
# Creating default bridge config
......@@ -256,8 +256,8 @@ def slapserver(config):
print "Creating %r" % br0_path
if not dry_run:
open(br0_path, 'w').write(
pkg_resources.resource_stream(__name__,
'template/ifcfg-br0.in').read())
pkg_resources.resource_string(__name__,
'template/ifcfg-br0.in'))
# Creating default limits config
limits_conf_path = os.path.join(mount_dir_path,
......@@ -265,8 +265,8 @@ def slapserver(config):
print "Overriding %s" % limits_conf_path
if not dry_run:
open(limits_conf_path, 'w').write(
pkg_resources.resource_stream(__name__,
'template/limits.conf.in').read())
pkg_resources.resource_string(__name__,
'template/limits.conf.in'))
# Writing ssh key
if config.need_ssh:
......@@ -305,8 +305,8 @@ def slapserver(config):
path = os.path.join(mount_dir_path, 'etc', 'init.d', script)
print "Creating %r" % path
if not dry_run:
open(path, 'w').write(pkg_resources.resource_stream(__name__,
'script/%s' % script).read())
open(path, 'w').write(pkg_resources.resource_string(__name__,
'script/%s' % script))
os.chmod(path, 0o755)
else:
for script in ['slapos_firstboot']:
......@@ -345,8 +345,8 @@ def prepare_scripts(config):
print "Creating %r" % path
if not dry_run:
open(path, 'w').write(
pkg_resources.resource_stream(__name__,
'script/slapos').read() % {
pkg_resources.resource_string(__name__,
'script/slapos') % {
'slapos_configuration': slapos_configuration
})
os.chmod(path, 0o755)
......@@ -355,8 +355,8 @@ def prepare_scripts(config):
print "Creating %r" % path
if not dry_run:
open(path, 'w').write(
pkg_resources.resource_stream(__name__,
'script/slapos.service').read() % {
pkg_resources.resource_string(__name__,
'script/slapos.service') % {
'slapos_configuration': slapos_configuration
})
os.chmod(path, 0o755)
......@@ -366,8 +366,8 @@ def prepare_scripts(config):
print "Creating %r" % path
if not dry_run:
open(path, 'w').write(
pkg_resources.resource_stream(__name__,
'template/clientipv4.conf.in').read())
pkg_resources.resource_string(__name__,
'template/clientipv4.conf.in'))
os.chmod(path, 0o755)
# Remove old-timers scripts
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment