6
priv = "com.ubuntu.systemservice.setnoproxy"
8
session_bus = dbus.SessionBus()
9
system_bus = dbus.SystemBus()
11
ser = dbus.Interface(system_bus.get_object("com.ubuntu.SystemService","/"),
12
"com.ubuntu.SystemService")
15
ser.set_no_proxy("host1,host2")
16
except dbus.DBusException, e:
18
obj = session_bus.get_object('org.freedesktop.PolicyKit.AuthenticationAgent', '/', False)
19
auth = dbus.Interface(obj, "org.freedesktop.PolicyKit.AuthenticationAgent")
20
res = auth.ObtainAuthorization(priv,
22
dbus.UInt32(os.getpid()),
26
print "setting no_proxy"
27
res=ser.set_no_proxy("host1,host2")
30
print "authentication failure"