#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
+from __future__ import print_function
import optparse
import sys
# because it uses a inet_pton / inet_ntop round trip to
# ascertain correctness.
- "::ffff:0:0/96", #this one fails on WIN2012r2
+ "::ffff:0:0/96", # this one fails on WIN2012r2
"::ffff:aaaa:a000/120",
"::ffff:10:0/120",
"::ffff:2:300/120",
try:
subnets.create_subnet(self.ldb, basedn, cidr, self.sitename)
except subnets.SubnetInvalid:
- print >> sys.stderr, "%s fails properly" % (cidr,)
+ print("%s fails properly" % (cidr,), file=sys.stderr)
continue
# we are here because it succeeded when it shouldn't have.
- print >> sys.stderr, "CIDR %s fails to fail" % (cidr,)
+ print("CIDR %s fails to fail" % (cidr,), file=sys.stderr)
failures.append(cidr)
subnets.delete_subnet(self.ldb, basedn, cidr)
if failures:
- print "These bad subnet names were accepted:"
+ print("These bad subnet names were accepted:")
for cidr in failures:
- print " %s" % cidr
+ print(" %s" % cidr)
self.fail()
def test_create_good_ranges(self):
try:
subnets.create_subnet(self.ldb, basedn, cidr, self.sitename)
except subnets.SubnetInvalid as e:
- print e
+ print(e)
failures.append(cidr)
continue
cidr))
if len(ret) != 1:
- print "%s was not created" % cidr
+ print("%s was not created" % cidr)
failures.append(cidr)
continue
subnets.delete_subnet(self.ldb, basedn, cidr)
if failures:
- print "These good subnet names were not accepted:"
+ print("These good subnet names were not accepted:")
for cidr in failures:
- print " %s" % cidr
+ print(" %s" % cidr)
self.fail()