[Swan-dev] [Swan-commit] Changes to ref refs/heads/master
Andrew Cagney
andrew.cagney at gmail.com
Mon Nov 28 19:21:48 UTC 2016
On 28 November 2016 at 12:25, Antony Antony <antony at phenome.org> wrote:
> On Sun, Nov 27, 2016 at 10:48:37PM -0500, Andrew Cagney wrote:
>> On 27 November 2016 at 13:40, Antony Antony <antony at vault.libreswan.fi>
wrote:
>> > commit 749c8d5ea579fde2831cf553909c5062b41e5e74
>> > Author: Antony Antony <antony at phenome.org>
>> > Date: Sun Nov 27 18:57:03 2016 +0100
>> >
>> > testing: kvm-targets.mk support fedora 25 as a test host/vm
>> >
>> > make install-kvm-test-domains is slow:) need improvements.
>>
>> FYI, transmogrify really only needs to happen once and not on every
>> boot. I've something similar to this in my queue - clone-example.sh
>> prototypes the idea.
>
> What would improve if it is not running every time?
> save a systemctl restart network.service?
That would help for starters.
> transmogrify could be more efficient and not run this every time.
> Run it only if the relevant files changed. That sort of things could be a
bit more easier in python.
So:
if not "#alias" in open("/root/.bashrc", "r").read():
output += "\n" + \
subprocess.getoutput("sed -i 's/alias/# alias/g' /root/.bashrc")
is simpler than:
# get rid of damn cp/mv/rm aliases for root
sed -i 's/alias/# alias/g' /root/.bashrc
I'm not convinced.
> Running every time could be useful in some cases. Say to change hosts in
a sepecific way.
> It has helped me in the past to push changes after test vms are built.
> Sometimes rebuilding vm is not ideal!
It contains redundant gibberish like:
# and some custom ipsec* files, but not directories
if os.path.isdir("/etc/ipsec.d"):
if not os.path.isdir("/etc/ipsec.d.stock"):
os.rename("/etc/ipsec.d", "/etc/ipsec.d.stock")
else:
shutil.rmtree("/etc/ipsec.d")
shutil.copytree("/testing/baseconfigs/all/etc/ipsec.d", "/etc/ipsec.d",
ignore=shutil.ignore_patterns("ipsec.conf.common"))
setting up /etc/ipsec.d et.al., is the domain of swan-prep. The first
thing swan-prep does is undo swan-transmogrify's damage, vis:
# wipe any old configs in /etc/ipsec.*
if os.path.isfile("/etc/ipsec.conf"):
os.unlink("/etc/ipsec.conf")
if os.path.isfile("/etc/ipsec.secrets"):
os.unlink("/etc/ipsec.secrets")
if os.path.isdir("/etc/ipsec.d"):
shutil.rmtree("/etc/ipsec.d")
os.mkdir("/etc/ipsec.d")
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.libreswan.org/pipermail/swan-dev/attachments/20161128/24fd3d39/attachment.html>
More information about the Swan-dev
mailing list