Am 08.06.2009 um 13:35 schrieb Paul Nasrat:

>> +    if uptime_seconds = Facter.value(:uptime_seconds)
>
> Assignment not comparison


And an assignment is exactly what I was aiming for: the assignment  
"fails" if the right hand doesn't exist, which is the condition in  
which I don't want to go into the branch, if the right hand exists, I  
get the assignment "for free" (the only pitfall here would be if a  
possible value of the assignment was 'false', which shouldn't happen).  
If you prefer to separate this into two distinct steps, I can rework  
it accordingly.

> White space noise pollution.

Yeah, well, I'm often a little maniac regarding needless white space  
at the end of lines and so on, I'll try to keep it in bounds next time  
around, sorry.

Regarding the complex logic: I wasn't sure if it should go into facter/ 
uptime or facter/util/uptime, my gripe with the later being getting  
bounced 3 or 4 times around the 2 files.


Anyway, this brings me to a question I still wanted to discuss, I  
haven't looked if it has already been discussed, but this concerns  
numerical values in facts: I'd love to not have to get rid of the  
trailing units, and have the most accurate possible (to the point  
where it still makes sense) values. I'm not sure if I'd want facter to  
also break it down for me, but I wouldn't mind that. Take for example  
uptime (this also applies to the memory and other stuff): I'd consider  
it enough to get the uptime in seconds in uptime, which I then could  
compute to something else in my program if need be. I don't mind if  
there also are uptime_{seconds, hours, days}, the point here being  
that if uptime says "3 days", I can't know if it's "3 days and 5  
hours" or "3 days and 23 hours". Sure, if facter can only get the  
uptime in days (as is the case with the call to 'uptime'), the uptime  
fact would get incremented in 86400 seconds steps, but that wouldn't  
matter either, because I would still have the added accuracy from  
boxes that support it. Not having the less accurate units as facts  
would also reduce the complexity of the modules.

It seems I have diverged a little bit here. If the answer is longer  
than "already discussed" or "won't do because", please move to a new  
thread.


A last word concerning the patch: I'm trying to get up to speed on  
ruby as well as on facter, and I'd like to help facter/puppet in the  
process, I'd appreciate a little more constructive comments.

Mit freundlichen Grüßen,

Felix Schäfer
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to