Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/web/lib/fog/system.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private static function _versionCompare()
public function __construct()
{
self::_versionCompare();
define('FOG_VERSION', '1.5.10.2294');
define('FOG_VERSION', '1.5.10.2301');
define('FOG_SCHEMA', 282);
define('FOG_BCACHE_VER', 143);
define('FOG_CLIENT_VERSION', '0.13.0');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,32 @@ public function __construct()
*/
public function onEvent($event, $data)
{
self::$message = 'This host has failed to image';
self::$shortdesc = 'Failed';
// TaskError sends the image and the reason FOS gave, and the reason is
// the only part of this an admin can act on -- "failed to image" says
// nothing the task list did not already show. Read defensively: a
// server whose web tree predates that change sends HostName alone, and
// reading a missing key would turn the notification into a PHP warning
// in an event that only fires when something has already gone wrong.
$image = (string) ($data['ImageName'] ?? '');
if ('' === $image) {
$image = _('an unnamed image');
}
$reason = (string) ($data['Reason'] ?? '');
if ('' === $reason) {
$reason = _('no reason was reported');
}
self::$shortdesc = _('Imaging Failed');
// Composed here rather than handed to the base class as a bare
// literal, because the substitution has to happen AFTER translation:
// a msgid built at runtime matches no catalog entry and never
// translates. The base's _() then finds nothing and passes this
// through unchanged. Positional specifiers so a translator can
// reorder the sentence.
self::$message = sprintf(
_('This host failed imaging %1$s: %2$s'),
$image,
$reason
);
parent::onEvent($event, $data);
}
}
21 changes: 19 additions & 2 deletions packages/web/lib/plugins/slack/events/imagefail_slack.event.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,32 @@ public function __construct()
*/
public function onEvent($event, $data)
{
// See the pushbullet listener: the reason is the actionable half of
// this notification, and every added key is read defensively so the
// plugin keeps working against a web tree that still sends HostName
// alone.
$image = (string) ($data['ImageName'] ?? '');
if ('' === $image) {
$image = _('an unnamed image');
}
$reason = (string) ($data['Reason'] ?? '');
if ('' === $reason) {
$reason = _('no reason was reported');
}
foreach ((array)self::getClass('SlackManager')
->find() as &$Token
) {
$args = array(
'channel' => $Token->get('name'),
// Whole sentence inside _() with positional specifiers: the
// old form put 'Host: %s ' outside the call and translated
// the tail on its own, which is not a sentence a translator
// can work with.
'text' => sprintf(
'Host: %s %s',
_('Host %1$s failed imaging %2$s: %3$s'),
$data['HostName'],
_('imaging failed.')
$image,
$reason
)
);
$Token->call('chat.postMessage', $args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2536,6 +2536,10 @@ msgstr "Telefonnummer"
msgid "Host"
msgstr "Host"

#, php-format
msgid "Host %1$s failed imaging %2$s: %3$s"
msgstr ""

#, fuzzy
msgid "Host AD Domain"
msgstr "Host AD-Domäne"
Expand Down Expand Up @@ -3075,6 +3079,10 @@ msgstr "Image Task vollständig"
msgid "Imaging Duration"
msgstr "Imaging Log"

#, fuzzy
msgid "Imaging Failed"
msgstr "Laden fehlgeschlagen: %s"

msgid "Imaging Log"
msgstr "Imaging Log"

Expand Down Expand Up @@ -6595,6 +6603,10 @@ msgstr "Diese Datei funktioniert nur auf Windows"
msgid "This host already exists"
msgstr "Dieser Host ist bereits vorhanden."

#, fuzzy, php-format
msgid "This host failed imaging %1$s: %2$s"
msgstr "Dieser Host ist bereits vorhanden."

msgid "This installation process may take a few minutes"
msgstr "Der Installationsprozess kann ein paar Minuten dauern, "

Expand Down Expand Up @@ -7345,6 +7357,10 @@ msgstr "vor"
msgid "all current storage nodes"
msgstr "momentanen Speicherknoten löschen."

#, fuzzy
msgid "an unnamed image"
msgstr "Ungültiges Image"

msgid "and Mac OS X"
msgstr "und Mac OS X"

Expand Down Expand Up @@ -7696,10 +7712,6 @@ msgstr "Images"
msgid "images to a storage group"
msgstr "bildet ab zu einer Speichergruppe"

#, fuzzy
msgid "imaging failed."
msgstr "Laden fehlgeschlagen: %s"

msgid "in seconds"
msgstr "in Sekunden"

Expand Down Expand Up @@ -7845,6 +7857,9 @@ msgstr "nicht verfügbar"
msgid "no login will appear"
msgstr "wird kein Login erscheinen."

msgid "no reason was reported"
msgstr ""

msgid "node is the distributor of the images"
msgstr "welcher Knoten die Images verteilt."

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2538,6 +2538,10 @@ msgstr "Home Phone"
msgid "Host"
msgstr "Host"

#, php-format
msgid "Host %1$s failed imaging %2$s: %3$s"
msgstr ""

#, fuzzy
msgid "Host AD Domain"
msgstr "AD Domain"
Expand Down Expand Up @@ -3076,6 +3080,10 @@ msgstr "after task completion"
msgid "Imaging Duration"
msgstr "Imaging Log"

#, fuzzy
msgid "Imaging Failed"
msgstr "Load failed: %s"

msgid "Imaging Log"
msgstr "Imaging Log"

Expand Down Expand Up @@ -6593,6 +6601,10 @@ msgstr ""
msgid "This host already exists"
msgstr "Printer already exists"

#, fuzzy, php-format
msgid "This host failed imaging %1$s: %2$s"
msgstr "Printer already exists"

msgid "This installation process may take a few minutes"
msgstr ""

Expand Down Expand Up @@ -7342,6 +7354,10 @@ msgstr " ago"
msgid "all current storage nodes"
msgstr "Invalid storage node"

#, fuzzy
msgid "an unnamed image"
msgstr "Invalid image"

msgid "and Mac OS X"
msgstr ""

Expand Down Expand Up @@ -7693,10 +7709,6 @@ msgstr "Images"
msgid "images to a storage group"
msgstr "Primary Storage Group"

#, fuzzy
msgid "imaging failed."
msgstr "Load failed: %s"

msgid "in seconds"
msgstr ""

Expand Down Expand Up @@ -7841,6 +7853,9 @@ msgstr "n/a"
msgid "no login will appear"
msgstr ""

msgid "no reason was reported"
msgstr ""

msgid "node is the distributor of the images"
msgstr ""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2530,6 +2530,10 @@ msgstr ""
msgid "Host"
msgstr "Equipo"

#, php-format
msgid "Host %1$s failed imaging %2$s: %3$s"
msgstr ""

#, fuzzy
msgid "Host AD Domain"
msgstr "Gestión de equipos"
Expand Down Expand Up @@ -3097,6 +3101,10 @@ msgstr "Imagen"
msgid "Imaging Duration"
msgstr "Descripción"

#, fuzzy
msgid "Imaging Failed"
msgstr "Error al cargar"

msgid "Imaging Log"
msgstr ""

Expand Down Expand Up @@ -6578,6 +6586,10 @@ msgstr ""
msgid "This host already exists"
msgstr "Ya existe este equipo"

#, fuzzy, php-format
msgid "This host failed imaging %1$s: %2$s"
msgstr "Ya existe este equipo"

msgid "This installation process may take a few minutes"
msgstr ""

Expand Down Expand Up @@ -7294,6 +7306,10 @@ msgstr ""
msgid "all current storage nodes"
msgstr "todos los Nodos de Almacenamiento"

#, fuzzy
msgid "an unnamed image"
msgstr "Imagen inválida"

msgid "and Mac OS X"
msgstr ""

Expand Down Expand Up @@ -7645,10 +7661,6 @@ msgstr "Imágenes"
msgid "images to a storage group"
msgstr "Añadir grupo de almacenamiento"

#, fuzzy
msgid "imaging failed."
msgstr "Error al cargar"

msgid "in seconds"
msgstr ""

Expand Down Expand Up @@ -7789,6 +7801,9 @@ msgstr ""
msgid "no login will appear"
msgstr "Gestión de login"

msgid "no reason was reported"
msgstr ""

msgid "node is the distributor of the images"
msgstr "exportar imágenes"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2247,6 +2247,10 @@ msgstr "Téléphone fixe"
msgid "Host"
msgstr "Machine"

#, php-format
msgid "Host %1$s failed imaging %2$s: %3$s"
msgstr ""

msgid "Host AD Domain"
msgstr "Domaine AD machine"

Expand Down Expand Up @@ -2722,6 +2726,10 @@ msgstr "Clonage terminé"
msgid "Imaging Duration"
msgstr "Durée du clonage"

#, fuzzy
msgid "Imaging Failed"
msgstr "La connexion a échoué"

msgid "Imaging Log"
msgstr "Journal des clonages"

Expand Down Expand Up @@ -5825,6 +5833,10 @@ msgstr "Ce fichier ne fonctionnera que sous Windows"
msgid "This host already exists"
msgstr "Cette machine existe déjà"

#, fuzzy, php-format
msgid "This host failed imaging %1$s: %2$s"
msgstr "Cette machine existe déjà"

msgid "This installation process may take a few minutes"
msgstr "Ce processus d'installation peut prendre quelques minutes"

Expand Down Expand Up @@ -6482,6 +6494,10 @@ msgstr "depuis"
msgid "all current storage nodes"
msgstr "tous les nœuds de stockage actuels"

#, fuzzy
msgid "an unnamed image"
msgstr "Image invalide"

msgid "and Mac OS X"
msgstr "and MacOS X"

Expand Down Expand Up @@ -6791,10 +6807,6 @@ msgstr "images"
msgid "images to a storage group"
msgstr "images vers un groupe de stockage"

#, fuzzy
msgid "imaging failed."
msgstr "La connexion a échoué"

msgid "in seconds"
msgstr "en secondes"

Expand Down Expand Up @@ -6922,6 +6934,9 @@ msgstr "n/a"
msgid "no login will appear"
msgstr "aucun login n'apparaîtra"

msgid "no reason was reported"
msgstr ""

msgid "node is the distributor of the images"
msgstr "nœud est le distributeur des images"

Expand Down
Loading