diff options
author | Christian A. Weber | 2014-01-13 20:24:19 +0100 |
---|---|---|
committer | Christian A. Weber | 2014-01-13 20:24:19 +0100 |
commit | 11a4360f8818e8732f104f5584fec3d6caf2e66a (patch) | |
tree | ef0b009629399e969e38cc528895a982cd17addd | |
parent | 4ef1423457af1284fde904803216514a34721f91 (diff) | |
download | itools-11a4360f8818e8732f104f5584fec3d6caf2e66a.tar.gz itools-11a4360f8818e8732f104f5584fec3d6caf2e66a.tar.bz2 itools-11a4360f8818e8732f104f5584fec3d6caf2e66a.zip |
add it::cdist() and it::cexec()
-rw-r--r-- | it.class | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -569,7 +569,7 @@ static function shell_command(/* $cmd, $values1 = array(), ... */) foreach ($args as $arg) $values = array_merge($values, (array)$arg); - #for escapeshellarg in it::_exec_quotevalue + # for escapeshellarg in it::_exec_quotevalue $oldlocale = setlocale(LC_CTYPE, 0); setlocale(LC_CTYPE, 'de_CH'); foreach (it::match('({(-?)([a-z0-9]\w*)})', $cmd, array('all' => true)) as $tags) @@ -616,6 +616,28 @@ static function _exec_quotevalue($value, $errmsg = "") /** + * execute a command on all cluster hosts of the current service + * @params see it::exec() + * @see it::exec, /opt/ultra/bin/cdist + */ +static function cexec(/* $cmd, $values1 = array(), ... */) +{ + return it::exec('cdist -c {CMD}', 'CMD' => call_user_func_array('it::shell_command', func_get_args())); +} + + +/** + * distribute local files to all cluster hosts of the current service + * @params $files filename or array of files to distribute + * @see it::exec, /opt/ultra/bin/cdist + */ +static function cdist(/* $cmd, $values1 = array(), ... */) +{ + return it::exec('cdist {FILES}', 'FILES' => func_get_args()); +} + + +/** * Convert an image to a given size and type (ensures input is an image) * @param $p['in'] Input filename (mandatory) * @param $p['out'] Output filename (mandatory) |