-#!/usr/bin/python
+#! /usr/bin/env python
# Copyright (c) 2009, 2010, 2011, 2012 Nicira, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
import ovs.dirs
from ovs.db import error
-from ovs.db import types
import ovs.util
import ovs.daemon
import ovs.db.idl
if host in self.psk_hosts:
raise error.Error("host %s already defined for psk" % host)
- if vals["certificate"] == None:
+ if vals["certificate"] is None:
raise error.Error("'certificate' not defined for %s" % host)
- elif vals["private_key"] == None:
+ elif vals["private_key"] is None:
# Assume the private key is stored in the same PEM file as
# the certificate. We make a copy of "vals" so that we don't
# modify the original "vals", which would cause the script
try:
ipsec.add_entry(vals["local_ip"], vals["remote_ip"], vals)
- except error.Error, msg:
+ except error.Error as msg:
vlog.warn("skipping ipsec config for %s: %s" % (name, msg))
new_interfaces = {}
for rec in idl.tables["Interface"].rows.itervalues():
- if rec.type == "ipsec_gre" or rec.type == "ipsec_gre64":
+ if rec.type == "ipsec_gre":
name = rec.name
options = rec.options
peer_cert_name = "ovs-%s.pem" % (options.get("remote_ip"))