On Wed, 2005-03-23 at 13:33 -0500, Dan Williams wrote:
On Wed, 2005-03-23 at 18:32 +0100, Nils Philippsen wrote:
> Hmm, how can I find out what methods a remote object implements -- dir()
> obviously doesn't tell me there is getType(), but it worked kind of:
>
> Traceback (most recent call last):
> File "./NetworkManagerTinkerer.py", line 18, in ?
> print dhcpOptions.getType ('NTP Servers')
> File "/usr/lib/python2.3/site-packages/dbus.py", line 208, in __call__
> reply_message = self._connection.send_with_reply_and_block(message,
> 5000)
> File "dbus_bindings.pyx", line 557, in
> dbus_bindings.Connection.send_with_reply_and_block
> dbus_bindings.DBusException: The requested DHCP option does not exist.
The other issue here might be that the server didn't reply with this
option at all. Which itself might be because we didn't explicitly
request it, or because it just doesn't have that option set. For
example, the office DHCP servers return the NTP server option, but
wireless routers usually do not. This is what just happened to me when
I switched to a wireless connection here at the office. I suspect that
apps will have to have intelligent fallbacks.
That's more or less what I have in mind -- try to get the DHCP option
(well, ask for it first -- e.g. I have configured my internal DHCP
server to deliver NTP servers if asked), see if it makes sense ;-) and
if one of either fails, set a default based on the network identified
(through domain names e.a.), whack some services and the like.
Nils
--
Nils Philippsen / Red Hat / nphilipp(a)redhat.com
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." -- B. Franklin, 1759
PGP fingerprint: C4A8 9474 5C4C ADE3 2B8F 656D 47D8 9B65 6951 3011