summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* Applying the patch by wyvern from #662. This should hopefully kill the ↵luke2007-06-181-60/+43
| | | | | | client hanging problems. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2604 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing error when commands fail -- the error code is now printed, instead of ↵luke2007-06-111-1/+1
| | | | | | the inspection of it git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2557 980ebf18-57e1-0310-9a29-db15c13687c0
* Set LANG/LC_ALL/LC_MESSAGES/LANGUAGE to 'C' whenever we execute things, so ↵mpalmer2007-05-031-0/+1
| | | | | | that the output that comes back is more easily parsed, without needing to understand all sorts of foreign languages git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2456 980ebf18-57e1-0310-9a29-db15c13687c0
* Okay, one last try -- the Util#binary command was not returning a path in ↵luke2007-04-271-1/+1
| | | | | | all true cases, and the provider tests were poorly written and missed it. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2427 980ebf18-57e1-0310-9a29-db15c13687c0
* Fix for #565: Final merge of changes from source:branches/execute-refactor ↵mccune2007-04-031-23/+60
| | | | | | | | | | | | | | | into source:trunk Generated with svn merge -r 2378:HEAD https://reductivelabs.com/svn/puppet/branches/execute-refactor trunk CHANGES: - Puppet::Util#execute now takes hash key/value pairs as arguments after the command array. - Processes executed from the base service provider are now silenced. That is, their standard input, output, and error pipes are all directed to /dev/null. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2385 980ebf18-57e1-0310-9a29-db15c13687c0
* Changing execution to reopen stdin to /dev/nullluke2007-03-191-0/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2318 980ebf18-57e1-0310-9a29-db15c13687c0
* Looks like I already accidentally committed the switch from using system() ↵luke2007-03-181-16/+0
| | | | | | to exec(). I am hoping this will fix the many problems people are having with processes hanging around (e.g., #509). This change just removes the attempts at closing TCPServer instances, which should now be fixed from using exec instead of system. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2297 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing cron support (I hope). It now uses providers, and seems to work, at ↵luke2007-03-171-2/+2
| | | | | | least on my os x box. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2284 980ebf18-57e1-0310-9a29-db15c13687c0
* Moving some of the stand-alone classes into the util/ subdirectory, to clean ↵luke2007-02-071-12/+12
| | | | | | up the top-level namespace a bit. This is a lot of file modifications, but most of them just change class names and file paths. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2178 980ebf18-57e1-0310-9a29-db15c13687c0
* Applying patch in #465.luke2007-01-301-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2124 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #440, albeit with a slightly hackish fix.luke2007-01-301-0/+15
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2120 980ebf18-57e1-0310-9a29-db15c13687c0
* Moving code from external sources into an external/ directoryluke2007-01-301-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2119 980ebf18-57e1-0310-9a29-db15c13687c0
* Looks like providers work again on Solaris.luke2006-12-281-4/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1980 980ebf18-57e1-0310-9a29-db15c13687c0
* I have not yet finished testing, but most of the providers now successfully ↵luke2006-12-281-2/+8
| | | | | | pass arrays to execute() instead of strings, which means that the vast majority of execution problems are now gone. I will finish testing tomorrow, hopefully, and will also hopefully be able to verify that the execution-related bugs are fixed. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1979 980ebf18-57e1-0310-9a29-db15c13687c0
* Allow execution of bare strings as long as there's no attempt to change uid/gidlutter2006-12-221-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1963 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #372 and #374. All is not perfect, since OS X still cannot set UID, ↵luke2006-12-191-6/+48
| | | | | | but it is much better. There is still plenty of bug-fixing to do on other platforms, I expect. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1954 980ebf18-57e1-0310-9a29-db15c13687c0
* Redoing the benchmarking a little bitluke2006-12-161-1/+5
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1941 980ebf18-57e1-0310-9a29-db15c13687c0
* Working some on the export/collect problem. It actually works now, but ↵luke2006-12-121-1/+1
| | | | | | there are not yet sufficient tests for it, so I will leave the bug open until we have got the new work in place. I also added a "rails" feature, so I do not have to keep testing whether ActiveRecord is defined. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1911 980ebf18-57e1-0310-9a29-db15c13687c0
* Ports are still broken, but I need to work on something else while I am ↵luke2006-11-131-1/+1
| | | | | | thinking about how to fix them. Stupid /etc/services. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1863 980ebf18-57e1-0310-9a29-db15c13687c0
* Merging the code over from the oscar branch. I will now be doing all ↵luke2006-11-081-103/+3
| | | | | | development in the trunk again, except for larger changes, which will still get their own branch. This is a merge of the changes from revision 1826 to revision 1834. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1835 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #291 -- the problem was that instead of throwing an error on a ↵luke2006-10-161-2/+1
| | | | | | missing server, puppet was just exiting. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1785 980ebf18-57e1-0310-9a29-db15c13687c0
* Many, many, many performance improvements in the compiler (I hope). I did ↵luke2006-10-061-1/+1
| | | | | | not change functionality anywhere, but I did some profiling and significantly reduced the runtime of many methods, and especially focused on some key methods that run many times. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1739 980ebf18-57e1-0310-9a29-db15c13687c0
* Merging the changes from the override-refactor branch. This is a ↵luke2006-10-041-0/+2
| | | | | | significant rewrite of the parser, but it has little affect on the rest of the code tree. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1726 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing suidmanager so it uses warnonce instead of using a variable that only ↵luke2006-09-291-0/+5
| | | | | | existed in Util git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1705 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing what I hope are the last batch of problems caused by the addition of ↵luke2006-09-271-1/+1
| | | | | | the suidmanager module. Also fixing a couple of other small issues that somehow cropped up. All tests should now pass again. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1699 980ebf18-57e1-0310-9a29-db15c13687c0
* File types were dying silently on OS X when the group specified in the ↵ajax2006-09-271-1/+1
| | | | | | | | | manifest was not a valid group. The code now generates some errors, but current behavior doesn't raise fatal exceptions git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1695 980ebf18-57e1-0310-9a29-db15c13687c0
* Some small housekeeping things that I saw while doing other bug huntingluke2006-09-221-0/+4
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1672 980ebf18-57e1-0310-9a29-db15c13687c0
* + Puppet::SUIDManager - This replaces all calls to the built-in ruby ↵erikh2006-09-221-83/+13
| | | | | | | | | | | 'Process' library for uid/gid/euid/egid operations, including (not surprisingly) Puppet::Util#asuser and a method to run commands and capture output. This is due to many inconsistencies (through bugfixes) between ruby versions in the 1.8.x branch. This is included in the core puppet library and can be used by all puppet types and providers. ! Modified Puppet::Util#uid to check (and warn) if passed a nil value. ! Changes to use Puppet::SUIDManager instead of Process and relevant Puppet::Util calls. ! Removed Puppet::Util#asuser. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1666 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing provider commands and Util#execute so they always include the command ↵luke2006-09-191-1/+1
| | | | | | output when possible, as mentioned on the list git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1635 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding a module for helping with warnings, starting only with the "warnonce" ↵luke2006-09-131-0/+1
| | | | | | method git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1578 980ebf18-57e1-0310-9a29-db15c13687c0
* Modifying the provider base class so that it defines a method for every used ↵luke2006-09-061-1/+2
| | | | | | command (e.g., you call "commands :rpm => 'rpm'", and it defines an "rpm" method. I then pushed this throughout the package providers, which are the heaviest users of commands. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1571 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding aptitude support, including a new util::package module that provides ↵luke2006-09-061-0/+1
| | | | | | a method for package version sorting, and a couple of smaller bug fixes. This fixes #237. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1570 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding a "withenv" execution util method, and using it in :exec for path ↵luke2006-09-051-0/+1
| | | | | | handling. Next will be other env handling. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1567 980ebf18-57e1-0310-9a29-db15c13687c0
* Removing all of the changes I made towards refactoring in the last couple of ↵luke2006-09-051-9/+0
| | | | | | days. They have all been moved into the sync-retrieve-refactor branch. This branch will soon become 0.19.0, and will not include that refactoring. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1555 980ebf18-57e1-0310-9a29-db15c13687c0
* This is the initial commit of the changes to sync and retrieve. Theluke2006-09-031-0/+9
| | | | | | | | | | | | | structure itself is now in place, and a few of the types (the most complicated ones -- file, user, group, plus exec since it was my easy first test) have been converted. I'm now going to finish going through all of the types and finish chnaging them so that they don't produce any warnings. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1546 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding back in the code to change the euid. I removed this yesterday ↵luke2006-08-291-0/+1
| | | | | | because I thought it was redundant. It is absolutely clear that I need to add tests for running as separate users. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1516 980ebf18-57e1-0310-9a29-db15c13687c0
* disabling chuser on os x, since it is broken with < ruby 1.8.5luke2006-08-291-4/+12
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1514 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding a module specifically for making doc generation easier, and adding ↵luke2006-08-281-0/+1
| | | | | | defaults info to provider docs. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1504 980ebf18-57e1-0310-9a29-db15c13687c0
* Making some of the metaprogramming a bit more explicit and a bit easier to ↵luke2006-08-201-0/+4
| | | | | | | | manage. In the process, I have created multiple Util modules, only one of which is used for this current commit. The main work in this commit is that I created a single, common method for dynamically creating classes and moved all of the Class.new users to using this class. It handles a lot of the complexity for me, and most of the users have just a couple of lines of code, now, instead of tens. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1473 980ebf18-57e1-0310-9a29-db15c13687c0
* A first pass of changing one of the types of names to titles. I still have ↵luke2006-08-161-5/+26
| | | | | | to fix a lot of tests, but the core itself is now working. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1471 980ebf18-57e1-0310-9a29-db15c13687c0
* Merging r1468 from the implementations branch with r1438 from when the ↵luke2006-08-141-12/+85
| | | | | | branch was first created. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1469 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing the master server so that it always uses the Facter hostname, not the ↵luke2006-07-311-1/+1
| | | | | | cert or IP hostname. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1433 980ebf18-57e1-0310-9a29-db15c13687c0
* adding a "thinmark" method, which does a simple benchmark with no loggingluke2006-06-301-2/+12
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1346 980ebf18-57e1-0310-9a29-db15c13687c0
* Cleaning up plugin handling a bit -- they can now be colon-separated paths, ↵luke2006-06-281-1/+1
| | | | | | and I added a separate "plugindest" setting for determining where plugins are synchronized to. The major feature I added, though, is that Puppet::Type now knows how to load plugins, and treats :pluginpath as a search path for plugins. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1330 980ebf18-57e1-0310-9a29-db15c13687c0
* Largely refactored how log destinations are handled, although it is not ↵luke2006-06-271-7/+19
| | | | | | exposed externally. Most of this work is related to handling a large number of small problems related to threading. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1315 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #173. At this point, I am just calling both "--add" and "on", or ↵luke2006-06-131-0/+3
| | | | | | "--del" and "off". This should probably be broken up into other states, but.... git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1265 980ebf18-57e1-0310-9a29-db15c13687c0
* Intermediate commit; most of the core zone functions now work, and some of ↵luke2006-06-021-1/+6
| | | | | | the configuration functions work. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1233 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding an "execute" method to Puppet::Util, and including the module in ↵luke2006-05-281-0/+16
| | | | | | element.rb git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1227 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing tests looking for pmapluke2006-04-301-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1154 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing a bunch of small bugs, mostly found by testing on solaris, and added ↵luke2006-04-171-13/+39
| | | | | | a check to the test system that points out memory growth git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1113 980ebf18-57e1-0310-9a29-db15c13687c0