Hi, Attached version adds a config option called allow_unknown_minions (False by default) and renames extend_hostname_to_fqdn to get_all_host_aliases which returns a flat list instead of a tuple. Tested with
import func.overlord.client as fc
for i in ["*", "www.planet-lab.org", "planetlab-02.cs.princeton.edu", "www",
"planetlab-02", "www;planetlab-02",
"www.planet-lab.org;planetlab-02.cs.princeton.edu"]:
for j in [True, False]:
try:
print i,j
my_overlord = fc.Overlord(i, delegate=j)
print my_overlord.command.run("true")
except:
print "ERROR"
print "\n\n"
on following hierarchy
[boot.planet-lab.org-rc18] ~ # cat /var/lib/func/map
---
www.planet-lab.org:
planetlab-01.cs.princeton.edu: {}
planetlab-02.cs.princeton.edu: {}
planetlab-03.cs.princeton.edu: {}
planetlab-04.cs.princeton.edu: {}
planetlab-05.cs.princeton.edu: {}
planetlab-06.cs.princeton.edu: {}
On Aug 10, 2010, at 2:08 PM, S.Çağlar Onur wrote:
> Hi Seth,
>
> On Aug 10, 2010, at 2:02 PM, seth vidal wrote:
>> If you remove the minions attribute creation there - how does the above
>> section of code not ALWAYS fail or at least traceout?
>>
>
> You are right and that version is the wrong one which contains some syntax
> errors as well, please see attached one.
>
>>> +def extend_hostname_to_fqdn(hostname):
>>> + try:
>>> + (fqdn, aliases, ips) = socket.gethostbyname_ex(hostname)
>>> + except socket.gaierror, e:
>>> + return (hostname, [])
>>> + else:
>>> + return (fqdn, aliases)
>>>
>>> def get_fresh_method_instance(function_ref):
>>> """
>>
>> Not sure I'm in love with how extend_hostname_to_fqdn() works - the
>> trick is to assume that whatever we're handed is _something_ valid - and
>> also to not assume that what is NOW the fqdn was always the fqdn.
>>
>> -sv
func.patch
Description: Binary data
Best regards, -- S.Çağlar Onur <[email protected]>
_______________________________________________ Func-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/func-list
