[master 1/1] Move ostree gobject version check next to the import (#1243543)

bcl installerbot-noreply at redhat.com
Thu Jul 16 16:03:57 UTC 2015


From: "Brian C. Lane" <bcl at redhat.com>

ostree is optional and may not be included in the environment that
anaconda is running in, so only check the version if it is actually
going to be used.
---
 pyanaconda/packaging/rpmostreepayload.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/packaging/rpmostreepayload.py b/pyanaconda/packaging/rpmostreepayload.py
index a1069d5..5fdeaad 100644
--- a/pyanaconda/packaging/rpmostreepayload.py
+++ b/pyanaconda/packaging/rpmostreepayload.py
@@ -32,7 +32,6 @@
 import gi
 gi.require_version("GLib", "2.0")
 gi.require_version("Gio", "2.0")
-gi.require_version("OSTree", "1.0")
 
 from gi.repository import GLib
 from gi.repository import Gio
@@ -134,6 +133,7 @@ def install(self):
         mainctx.push_thread_default()
 
         cancellable = None
+        gi.require_version("OSTree", "1.0")
         from gi.repository import OSTree
         ostreesetup = self.data.ostreesetup
         log.info("executing ostreesetup=%r", ostreesetup)
@@ -267,6 +267,7 @@ def recreateInitrds(self):
     def postInstall(self):
         super(RPMOSTreePayload, self).postInstall()
 
+        gi.require_version("OSTree", "1.0")
         from gi.repository import OSTree
         cancellable = None
 


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/b577b5834f84f862c0f80a02dd2475e1096ba41c


More information about the anaconda-patches mailing list