コード例 #1
0
        def activate_live_be(cmd):
            cmd += [self.clone_dir]

            # Activate the clone.
            exec_cmd(cmd)

            if be.beActivate(self.be_name_clone) != 0:
                emsg(_("pkg: unable to activate %s") \
                    % self.be_name_clone)
                return

            # Consider the last operation a success, and log it as
            # ending here so that it will be recorded in the new
            # image's history.
            self.img.history.log_operation_end()

            if be.beUnmount(self.be_name_clone) != 0:
                emsg(_("pkg: unable to unmount %s") \
                    % self.clone_dir)
                return

            os.rmdir(self.clone_dir)

            msg(_("""
A clone of %s exists and has been updated and activated.
On the next boot the Boot Environment %s will be mounted on '/'.
Reboot when ready to switch to this updated BE.
""") % \
                (self.be_name, self.be_name_clone))
コード例 #2
0
ファイル: bootenv.py プロジェクト: jrdalpra/svnedge-console
                def activate_live_be(cmd):
                        cmd += [self.clone_dir]

                        # Activate the clone.
                        exec_cmd(cmd)

                        if be.beActivate(self.be_name_clone) != 0:
                                emsg(_("pkg: unable to activate %s") \
                                    % self.be_name_clone)
                                return

                        # Consider the last operation a success, and log it as
                        # ending here so that it will be recorded in the new
                        # image's history.
                        self.img.history.log_operation_end()

                        if be.beUnmount(self.be_name_clone) != 0:
                                emsg(_("pkg: unable to unmount %s") \
                                    % self.clone_dir)
                                return

                        os.rmdir(self.clone_dir)

                        msg(_("""
A clone of %s exists and has been updated and activated.
On the next boot the Boot Environment %s will be mounted on '/'.
Reboot when ready to switch to this updated BE.
""") % \
                            (self.be_name, self.be_name_clone))
コード例 #3
0
ファイル: bootenv.py プロジェクト: ripudamank2/pkg5
        def activate_live_be():
            if set_active and \
                be.beActivate(self.be_name_clone) != 0:
                logger.error(
                    _("pkg: unable to activate "
                      "{0}").format(self.be_name_clone))
                return

            # Consider the last operation a success, and log it as
            # ending here so that it will be recorded in the new
            # image's history.
            self.img.history.operation_new_be = self.be_name_clone
            self.img.history.operation_new_be_uuid = self.be_name_clone_uuid
            self.img.history.log_operation_end(
                release_notes=self.img.imageplan.pd.release_notes_name)

            if be.beUnmount(self.be_name_clone) != 0:
                logger.error(
                    _("unable to unmount BE "
                      "{be_name} mounted at {be_path}").format(
                          be_name=self.be_name_clone, be_path=self.clone_dir))
                return

            os.rmdir(self.clone_dir)

            if set_active:
                logger.info(
                    _("""
A clone of {be_name} exists and has been updated and activated.
On the next boot the Boot Environment {be_name_clone} will be
mounted on '/'.  Reboot when ready to switch to this updated BE.

*** Reboot required ***
New BE: {be_name_clone}
""").format(**self.__dict__))
            else:
                logger.info(
                    _("""
A clone of {be_name} exists and has been updated.  To set the
new BE as the active one on next boot, execute the following
command as a privileged user and reboot when ready to switch to
the updated BE:

beadm activate {be_name_clone}
""").format(**self.__dict__))
コード例 #4
0
ファイル: bootenv.py プロジェクト: aszeszo/test
                def activate_live_be():
                        if set_active and \
                            be.beActivate(self.be_name_clone) != 0:
                                logger.error(_("pkg: unable to activate %s") \
                                    % self.be_name_clone)
                                return

                        # Consider the last operation a success, and log it as
                        # ending here so that it will be recorded in the new
                        # image's history.
                        self.img.history.operation_new_be = self.be_name_clone
                        self.img.history.operation_new_be_uuid = self.be_name_clone_uuid
                        self.img.history.log_operation_end()

                        if be.beUnmount(self.be_name_clone) != 0:
                                logger.error(_("unable to unmount BE "
                                    "%(be_name)s mounted at %(be_path)s") % {
                                    "be_name": self.be_name_clone,
                                    "be_path": self.clone_dir })
                                return

                        os.rmdir(self.clone_dir)

                        if set_active:
                                logger.info(_("""
A clone of %(be_name)s exists and has been updated and activated.
On the next boot the Boot Environment %(be_name_clone)s will be
mounted on '/'.  Reboot when ready to switch to this updated BE.
""") % self.__dict__)
                        else:
                                logger.info(_("""
A clone of %(be_name)s exists and has been updated.  To set the
new BE as the active one on next boot, execute the following
command as a privileged user and reboot when ready to switch to
the updated BE:

beadm activate %(be_name_clone)s
""") % self.__dict__)
コード例 #5
0
ファイル: bootenv.py プロジェクト: ripudamank2/pkg5
 def set_default_be(be_name):
     return be.beActivate(be_name)
コード例 #6
0
ファイル: bootenv.py プロジェクト: aszeszo/test
 def set_default_be(be_name):
         return be.beActivate(be_name)