def discover_BEs(self, zpool_name="", name=None):
        """ discover_BEs - method to discover all Boot Environments (BEs) on
        the system.
        """
        be_list = be.be_list(name)

        # walk each zpool already discovered and add BEs as necessary
        for zpool in self.root.get_descendants(class_type=Zpool):
            # check to see if we only want a subset of zpools.
            if zpool_name and zpool_name != zpool.name:
                continue

            for be_name, be_pool, root_ds, is_active in be_list:
                if be_pool == zpool.name:
                    zpool.insert_children(BE(be_name))
Esempio n. 2
0
def _reboot_cmds(is_x86):
    '''Generate list of cmds to try fast rebooting'''
    cmds = list()

    for be_name, be_pool, root_ds, is_active in be_list():
        if is_active:
            if is_x86:
                cmds.append([REBOOT, "-f", "--", root_ds])
            else:
                # SPARC requires "-Z" before the root dataset
                cmds.append([REBOOT, "-f", "--", "-Z", root_ds])

    # Fallback reboot. If the subprocess.call(..) command above fails, simply
    # do a standard reboot.
    cmds.append([REBOOT])
    return cmds
def _reboot_cmds(is_x86):
    '''Generate list of cmds to try fast rebooting'''
    cmds = list()
    
    all_be = be_list()

    for be_name, be_pool, root_ds, is_active in all_be:
        if is_active:
            if is_x86:
                cmds.append([REBOOT, "-f", "--", root_ds])
            else:
                # SPARC requires "-Z" before the root dataset
                cmds.append([REBOOT, "-f", "--", "-Z", root_ds])

    # Fallback reboot. If the subprocess.call(..) command above fails,
    # simply do a standard reboot.
    cmds.append([REBOOT])
    return cmds
Esempio n. 4
0
 def exists(self):
     """ property to check for the existance of the BE
     """
     exists = be_list(self.name)
     return exists
 def exists(self):
     """ property to check for the existance of the BE
     """
     exists = be_list(self.name)
     return exists