Title: [opsview] [11334] Fixed resetting of UUIDs for known bad ones
Revision
11334
Author
tvoon
Date
2013-02-04 14:44:42 +0000 (Mon, 04 Feb 2013)

Log Message

Fixed resetting of UUIDs for known bad ones

Modified Paths


Modified: trunk/CHANGES
===================================================================
--- trunk/CHANGES	2013-02-04 13:24:07 UTC (rev 11333)
+++ trunk/CHANGES	2013-02-04 14:44:42 UTC (rev 11334)
@@ -56,6 +56,7 @@
     Fixed acknowledgement option to only appear in menus if the object is unhandled
     Fixed possible error message on RH systems when using init scripts
     Fixed bug with community string in check_snmp_netscreen_activesessions and check_snmp_netscreen_cpu
+    Fixed resetting of UUID when known bad UUIDs detected
 
 3.20120925
     FEATURES:

Modified: trunk/opsview-core/installer/upgradedb_opsview.pl
===================================================================
--- trunk/opsview-core/installer/upgradedb_opsview.pl	2013-02-04 13:24:07 UTC (rev 11333)
+++ trunk/opsview-core/installer/upgradedb_opsview.pl	2013-02-04 14:44:42 UTC (rev 11334)
@@ -4665,6 +4665,21 @@
     $db->updated;
 }
 
+unless (
+    $db->is_installed( '20130204baduuid', "Checking for bad UUID", "all" ) )
+{
+    my $rows_affected = $dbh->do(
+        q[ UPDATE systempreferences SET uuid='' WHERE uuid IN ('4D479026-48F1-11E2-80B3-DDBC566DC397','42BFFD96-6570-11E2-B6D9-D2F0548F4B8A') ]
+    );
+
+    if ( $rows_affected > 0 ) {
+        $db->print(
+            "WARNING! A bad UUID has been detected on this system. If you use Opsview Mobile for iOS, you will need to run the application again to re-register your system for push notifications. See http://docs.opsview.com/doku.php?id=opsview:push-notifications-duplicate-uuid for details"
+        );
+    }
+    $db->updated;
+}
+
 # PLACEHOLDER
 # For future upgrade of Opsview Core where you cannot have an automatic Opsview reload
 # We mark this upgrade lock file so that post installs do not generate an unactivated configuration

Modified: trunk/opsview-core/t/var/opsview.test.db
===================================================================
--- trunk/opsview-core/t/var/opsview.test.db	2013-02-04 13:24:07 UTC (rev 11333)
+++ trunk/opsview-core/t/var/opsview.test.db	2013-02-04 14:44:42 UTC (rev 11334)
@@ -2061,6 +2061,7 @@
 INSERT INTO `schema_version` VALUES ('20121023hostsidx','all','opsview.hosts (ip,name) index','2012-10-23 16:38:02',0);
 INSERT INTO `schema_version` VALUES ('20130115envvars','all','Support for envvars in plugins','2013-01-15 09:37:25',0);
 INSERT INTO `schema_version` VALUES ('20130122snmpport','all','Increasing the size of snmp_port','2013-01-22 10:18:48',0);
+INSERT INTO `schema_version` VALUES ('20130204baduuid','all','Checking for bad UUID','2013-02-04 14:40:14',0);
 INSERT INTO `schema_version` VALUES ('3.0','4',NULL,NULL,NULL);
 INSERT INTO `schema_version` VALUES ('3.1','4',NULL,NULL,NULL);
 INSERT INTO `schema_version` VALUES ('3.11','15',NULL,NULL,NULL);

_______________________________________________
Opsview-checkins mailing list
[email protected]
http://lists.opsview.org/lists/listinfo/opsview-checkins

Reply via email to