#!/usr/bin/perl -n BEGIN { print <<'EOF'; <% from invirt.config import structs as cfg %> EOF } s/^node\.startup = manual/node.startup = automatic/m; # mako just generally doesn't deal well with lines that start with # hashes, so we'll strip them # # And empty lines too, just for cleanliness s/^#.*$//m; # This is how long requests will sit in the queue before being failed # up to the next layer (i.e. multipath) s/^#?(node\.session\.timeo\.replacement_timeout).*$/\1 = 15/m; print unless /^$/; END { print <<'EOF'; node.session.auth.authmethod = CHAP node.session.auth.username = ${cfg.iscsi.username} node.session.auth.password = ${cfg.iscsi.password} discovery.sendtargets.auth.authmethod = CHAP discovery.sendtargets.auth.username = ${cfg.iscsi.username} discovery.sendtargets.auth.password = ${cfg.iscsi.password} EOF }