[debian-edu-commits] r80358 - in branches/wheezy/debian-edu-config: debian share/debian-edu-config/tools

pere at alioth.debian.org pere at alioth.debian.org
Sat Jun 8 07:38:23 UTC 2013


Author: pere
Date: 2013-06-08 07:38:22 +0000 (Sat, 08 Jun 2013)
New Revision: 80358

Modified:
   branches/wheezy/debian-edu-config/debian/changelog
   branches/wheezy/debian-edu-config/share/debian-edu-config/tools/subnet-change
Log:
Made sure subnet-change warn those trying to switch to one of the
problematic subnets, while allowing them to continue by adding
option -f.

Modified: branches/wheezy/debian-edu-config/debian/changelog
===================================================================
--- branches/wheezy/debian-edu-config/debian/changelog	2013-06-08 07:23:05 UTC (rev 80357)
+++ branches/wheezy/debian-edu-config/debian/changelog	2013-06-08 07:38:22 UTC (rev 80358)
@@ -1,3 +1,11 @@
+debian-edu-config (1.706~svn80358) UNRELEASED; urgency=low
+
+  * Made sure subnet-change warn those trying to switch to one of the
+    problematic subnets, while allowing them to continue by adding
+    option -f.
+
+ -- Petter Reinholdtsen <pere at debian.org>  Sat, 08 Jun 2013 09:37:16 +0200
+
 debian-edu-config (1.706~svn80357) wheezy-test; urgency=low
 
   * Translation updates:

Modified: branches/wheezy/debian-edu-config/share/debian-edu-config/tools/subnet-change
===================================================================
--- branches/wheezy/debian-edu-config/share/debian-edu-config/tools/subnet-change	2013-06-08 07:23:05 UTC (rev 80357)
+++ branches/wheezy/debian-edu-config/share/debian-edu-config/tools/subnet-change	2013-06-08 07:38:22 UTC (rev 80358)
@@ -33,16 +33,32 @@
  -n subnet      Subnet to change to with 10.11.12.13/24 notation.
  -s ldapserver  Which LDAP server to connect to.  The default autodetected.
  -b ldapbase    LDAP base to operate on.  The default is autodetected.
+ -f             Force the change to problematic subnets.
 EOF
     exit $retval;
 }
 my %opts;
-getopts("b:dn:s:", \%opts) || usage(1);
+getopts("b:dfn:s:", \%opts) || usage(1);
 
 if (!$opts{n}) {
     usage(1);
 }
 
+my @problematic = qw(192.168.0.0/24 192.168.1.0/24);
+
+if (!$opts{f}) {
+    for my $subnet (@problematic) {
+        if ($subnet eq $opts{n}) {
+            my $str = join(", ", @problematic);
+            print <<EOF;
+error: Switching to subnets $str are problematic.
+error: Consider switching to another.
+error: Use -f to force the change anyway.
+EOF
+            exit(1);
+        }
+    }
+}
 my $oldsubnet = new Net::Netmask('10.0.0.0/8');
 my $newsubnet = new Net::Netmask($opts{n});
 




More information about the debian-edu-commits mailing list