Merge branch 'mdw/multi-priv'
[tripe] / svc / watch.in
index 140f1fc..5917c79 100644 (file)
@@ -577,15 +577,15 @@ def encode_envvars(env, prefix, vars):
     env[prefix + r_bad.sub('_', k.upper())] = v
 
 r_bad = RX.compile(r'[\W_]+')
-def envvars(info):
+def envvars(peer, info):
   """
-  Translate the database INFO dictionary for a peer into a dictionary of
+  Translate the database INFO dictionary for a PEER into a dictionary of
   environment variables with plausible upper-case names and a P_ prefix.
   Also collect the crypto information into A_ variables.
   """
   env = {}
   encode_envvars(env, 'P_', info)
-  encode_envvars(env, 'A_', S.algs())
+  encode_envvars(env, 'A_', S.algs(peer))
   return env
 
 def ifupdown(what, peer, info, *args):
@@ -602,7 +602,7 @@ def ifupdown(what, peer, info, *args):
   c = Command([what, peer], q, what,
               M.split(info[what], quotep = True)[0] +
               [peer] + list(args),
-              envvars(info))
+              envvars(peer, info))
   potwatch(what, peer, q)
 
 def addpeer(info, peer, ifname, *addr):