summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorChristian A. Weber2014-01-13 20:24:19 +0100
committerChristian A. Weber2014-01-13 20:24:19 +0100
commit11a4360f8818e8732f104f5584fec3d6caf2e66a (patch)
treeef0b009629399e969e38cc528895a982cd17addd /it.class
parent4ef1423457af1284fde904803216514a34721f91 (diff)
downloaditools-11a4360f8818e8732f104f5584fec3d6caf2e66a.tar.gz
itools-11a4360f8818e8732f104f5584fec3d6caf2e66a.tar.bz2
itools-11a4360f8818e8732f104f5584fec3d6caf2e66a.zip
add it::cdist() and it::cexec()
Diffstat (limited to 'it.class')
-rw-r--r--it.class24
1 files changed, 23 insertions, 1 deletions
diff --git a/it.class b/it.class
index d62a57c..c8b4d19 100644
--- a/it.class
+++ b/it.class
@@ -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)