UNPKG

mecano

Version:

Common functions for system deployment.

37 lines (33 loc) 800 B
// Generated by CoffeeScript 1.11.1 var docker, util; module.exports = function(options, callback) { var cmd, k, ref, v; options.log({ message: "Entering Docker restart", level: 'DEBUG', module: 'mecano/lib/docker/restart' }); if (options.docker == null) { options.docker = {}; } ref = options.docker; for (k in ref) { v = ref[k]; if (options[k] == null) { options[k] = v; } } if (options.container == null) { return callback(Error('Missing container parameter')); } cmd = 'restart'; if (options.timeout != null) { cmd += " -t " + options.timeout; } cmd += " " + options.container; return this.execute({ cmd: docker.wrap(options, cmd) }, docker.callback); }; docker = require('../misc/docker'); util = require('util');