]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- allow to disable zypp plugin via environment variable (see fate#319316) 186/head
authorArvin Schnell <aschnell@suse.de>
Wed, 26 Aug 2015 10:23:50 +0000 (12:23 +0200)
committerArvin Schnell <aschnell@suse.de>
Wed, 26 Aug 2015 10:23:50 +0000 (12:23 +0200)
package/snapper.changes
scripts/zypp-plugin.py

index e85f6a99bc92ed086f0df737e5a062853af371af..afc94db10bcbecaf4197f44431a1d2d3c45b7db7 100644 (file)
@@ -1,3 +1,9 @@
+-------------------------------------------------------------------
+Wed Aug 26 11:58:24 CEST 2015 - aschnell@suse.de
+
+- allow to disable zypp plugin via environment variable (see
+  fate#319316)
+
 -------------------------------------------------------------------
 Tue Jul 07 12:49:16 CEST 2015 - aschnell@suse.de
 
index 07eeb1f0fcd3bdbe40f12a736f4f146f5d0f683f..110ed3c4cb654b32040e01a8cd73b7998af8463a 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/python
 #
 # Copyright (c) [2011-2014] Novell, Inc.
+# Copyright (c) [2015] SUSE LLC
 #
 # All Rights Reserved.
 #
@@ -23,7 +24,7 @@
 #
 
 
-from os import readlink, getppid
+from os import readlink, getppid, environ
 from os.path import basename
 import sys
 import fnmatch
@@ -236,17 +237,26 @@ class MyPlugin(Plugin):
         self.ack()
 
 
+if "DISABLE_SNAPPER_ZYPP_PLUGIN" in environ:
 
-config = Config()
+    logging.info("$DISABLE_SNAPPER_ZYPP_PLUGIN is set - disabling snapper-zypp-plugin")
 
-try:
-    bus = SystemBus()
-    snapper = Interface(bus.get_object('org.opensuse.Snapper', '/org/opensuse/Snapper'),
-                        dbus_interface='org.opensuse.Snapper')
-except DBusException as e:
-    logging.error("connect to snapperd failed:")
-    logging.error("  %s", e)
-    sys.exit(1)
+    # a dummy Plugin is needed
+    plugin = Plugin()
+    plugin.main()
 
-plugin = MyPlugin()
-plugin.main()
+else:
+
+    config = Config()
+
+    try:
+        bus = SystemBus()
+        snapper = Interface(bus.get_object('org.opensuse.Snapper', '/org/opensuse/Snapper'),
+                            dbus_interface='org.opensuse.Snapper')
+    except DBusException as e:
+        logging.error("connect to snapperd failed:")
+        logging.error("  %s", e)
+        sys.exit(1)
+
+    plugin = MyPlugin()
+    plugin.main()