コード例 #1
0
ファイル: bootenv.py プロジェクト: jrdalpra/svnedge-console
 def exec_cmd(cmd):
         ret = 0
         try:
                 ret = subprocess.call(cmd,
                     stdout = file("/dev/null"),
                     stderr = subprocess.STDOUT)
         except OSError, e:
                 emsg(_("pkg: A system error %(e)s was caught "
                     "executing %(cmd)s") %
                     { "e": e, "cmd": " ".join(cmd) })
コード例 #2
0
 def exec_cmd(cmd):
     ret = 0
     try:
         ret = subprocess.call(cmd,
                               stdout=file("/dev/null"),
                               stderr=subprocess.STDOUT)
     except OSError, e:
         emsg(
             _("pkg: A system error %(e)s was caught "
               "executing %(cmd)s") % {
                   "e": e,
                   "cmd": " ".join(cmd)
               })
コード例 #3
0
ファイル: bootenv.py プロジェクト: aszeszo/test
        def update_boot_archive(self):
                """Rebuild the boot archive in the current image.
                Just report errors; failure of pkg command is not needed,
                and bootadm problems should be rare."""
                cmd = [
                    "/sbin/bootadm", "update-archive", "-R",
                    self.img.get_root()
                    ]

                try:
                        ret = subprocess.call(cmd,
                            stdout = open(os.devnull), stderr=subprocess.STDOUT)
                except OSError, e:
                        logger.error(_("pkg: A system error %(e)s was "
                            "caught executing %(cmd)s") % { "e": e,
                            "cmd": " ".join(cmd) })
                        return
コード例 #4
0
    def update_boot_archive(self):
        """Rebuild the boot archive in the current image.
                Just report errors; failure of pkg command is not needed,
                and bootadm problems should be rare."""
        cmd = ["/sbin/bootadm", "update-archive", "-R", self.img.get_root()]

        try:
            ret = subprocess.call(cmd,
                                  stdout=open(os.devnull),
                                  stderr=subprocess.STDOUT)
        except OSError as e:
            logger.error(
                _("pkg: A system error {e} was "
                  "caught executing {cmd}").format(e=e, cmd=" ".join(cmd)))
            return

        if ret:
            logger.error(
                _("pkg: '{cmd}' failed. \nwith "
                  "a return code of {ret:d}.").format(cmd=" ".join(cmd),
                                                      ret=ret))