protected function execute(InputInterface $input, OutputInterface $output)
 {
     $moduleCode = $this->formatModuleName($input->getArgument("module"));
     $module = ModuleQuery::create()->findOneByCode($moduleCode);
     if (null === $module) {
         throw new \RuntimeException(sprintf("module %s not found", $moduleCode));
     }
     if ($module->getActivate() == BaseModule::IS_NOT_ACTIVATED) {
         throw new \RuntimeException(sprintf("module %s is already deactivated", $moduleCode));
     }
     try {
         $event = new ModuleToggleActivationEvent($module->getId());
         $module = ModuleQuery::create()->findPk($module->getId());
         if ($module->getMandatory() == BaseModule::IS_MANDATORY) {
             if (!$this->askConfirmation($input, $output)) {
                 return;
             }
             $event->setAssumeDeactivate(true);
         }
         if ($input->getOption("with-dependencies")) {
             $event->setRecursive(true);
         }
         $this->getDispatcher()->dispatch(TheliaEvents::MODULE_TOGGLE_ACTIVATION, $event);
     } catch (\Exception $e) {
         throw new \RuntimeException(sprintf("Deactivation fail with Exception : [%d] %s", $e->getCode(), $e->getMessage()));
     }
     //impossible to change output class in CommandTester...
     if (method_exists($output, "renderBlock")) {
         $output->renderBlock(array('', sprintf("Deactivation succeed for module %s", $moduleCode), ''), "bg=green;fg=black");
     }
 }