示例#1
0
    def _install(self):
        """
        """

        self._logger.info("Installing nginx")

        proc = exec_elevated([which("make"), "install"], cwd = self._source_dir)
        if proc.wait() > 0:
            raise exceptions.ApplicationBuildError("Installation failed")

        self._logger.info("Finished installing nginx")
    def _exec_cmd(self, action, args):
        """
        """

        args.insert(0, action)
        args.insert(0, "-y")
        args.insert(0, self._yum_launcher)

        try:
            proc = exec_elevated(args)
            status = proc.wait()

            if status > 0:
                raise exceptions.ElevatedApplicationError()
        except exceptions.ElevatedApplicationError:
            print(constants.EXITMESSAGE_PACKAGEMANAGER)
            sys.exit(constants.EXITSTATUS_PACKAGEMANAGER)
        except KeyboardInterrupt:
            print(constants.MESSAGE_CANNOT_INTERRUPT)
            proc.wait()