don't check for updates unless we're online (#212732)
authorJeremy Katz <katzj@redhat.com>
Wed, 25 Jul 2007 21:45:56 +0000 (17:45 -0400)
committerJeremy Katz <katzj@redhat.com>
Wed, 25 Jul 2007 21:45:56 +0000 (17:45 -0400)
yum-updatesd

index c1c0424..f228c3b 100755 (executable)
@@ -137,6 +137,13 @@ def checkUpdates(opts, wait = False):
     if helperProcess is not None:
         print >> sys.stderr, "Helper process already running"
         return True
+
+    bus = dbus.SystemBus()
+    o = bus.get_object("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager")
+    if o.state != 3:
+        print >> sys.stderr, "Not online; can't check for updates"
+        return True
+
     if os.path.exists("./yum-updatesd-helper") and opts.debug:
         args = ["./yum-updatesd-helper", "--check"]
     else: