def _mbean_names_exist(self, location):
     """
     Check to see if there are any configured MBeans for the current location
     :param location: context with the current location
     :return: True if MBeans of the type at the location exist
     """
     path = self._alias_helper.get_wlst_list_path(location)
     mbean_name_map = None
     try:
         mbean_name_map = wlst_helper.lsc(path)
     except DiscoverException, de:
         _logger.warning('WLSDPLY-06130', path, de.getLocalizedMessage())
    def lsc(self, path=None, log_throwing=True):
        """
        Get the list of child folders from WLST.
        :param path: the WLST path, by default it uses the current location
        :param log_throwing: whether to log throwing if the path does not exist, the default is True
        :return: the list of folder names
        :raises: BundleAwareException of the specified type: if an error occurs
        """
        _method_name = 'lsc'

        try:
            result = wlst_helper.lsc(path=path, log_throwing=log_throwing)
        except PyWLSTException, pwe:
            ex = exception_helper.create_exception(self.__exception_type, 'WLSDPLY-19105',
                                                   pwe.getLocalizedMessage(), error=pwe)
            self.__logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
            raise ex
Exemple #3
0
    def _has_machines_folder(self, base_folder):
        """
        This is a private method.

        In WLST offline, the Machine folder does not always show up even though it is there so
        this method determines whether the machines folder is really there or not.
        :param base_folder: the folder name to check
        :return: true, if the Machine folder exists, false otherwise
        """
        if base_folder in wlst_helper.lsc():
            result = True
        elif self._wlst_mode == WlstModes.OFFLINE:
            try:
                wlst_helper.cd(base_folder)
                result = True
            except PyWLSTException:
                result = False
        else:
            result = False
        return result