def _get_attributes_for_current_location_online(self, location):
     _method_name = '_get_attributes_for_current_location_online'
     lsa_attributes = dict()
     path = self._alias_helper.get_wlst_attributes_path(location)
     try:
         lsa_attributes = wlst_helper.lsa(path)
         mbi_attributes = _get_mbi_attribute_list()
         if mbi_attributes:
             for lsa_attribute_name in lsa_attributes:
                 if lsa_attribute_name in lsa_attributes and lsa_attribute_name not in mbi_attributes:
                     _logger.finer('WLSDPLY-06142', lsa_attribute_name)
                     del lsa_attributes[lsa_attribute_name]
             for mbi_attribute_name in mbi_attributes:
                 if mbi_attribute_name not in lsa_attributes and mbi_attribute_name in mbi_attributes:
                     # don't count on the item in the get required list in caller, just get the value
                     # and add it to our lsa list
                     _logger.finer('WLSDPLY-06141',
                                   mbi_attribute_name,
                                   class_name=_class_name,
                                   method_name=_method_name)
                     lsa_attributes[mbi_attribute_name] = wlst_helper.get(
                         mbi_attribute_name)
     except PyWLSTException, pe:
         name = location.get_model_folders()[-1]
         _logger.fine('WLSDPLY-06109',
                      name,
                      str(location),
                      pe.getLocalizedMessage(),
                      class_name=_class_name,
                      method_name=_method_name)
 def _get_attributes_for_current_location_offline(self, location):
     _method_name = '_get_attributes_for_current_location_offline'
     attributes = []
     path = self._alias_helper.get_wlst_attributes_path(location)
     try:
         attributes = wlst_helper.lsa(path)
     except PyWLSTException, pe:
         name = location.get_model_folders()[-1]
         _logger.fine('WLSDPLY-06109', name, str(location), pe.getLocalizedMessage(), class_name=_class_name,
                      method_name=_method_name)
    def lsa(self, path=None, log_throwing=True):
        """
        Get the map of attributes and their values 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 map of attributes and their values
        :raises: BundleAwareException of the specified type: if an error occurs
        """
        _method_name = 'lsa'

        try:
            result = wlst_helper.lsa(path=path, log_throwing=log_throwing)
        except PyWLSTException, pwe:
            if path is None:
                path = self.get_pwd()
            ex = exception_helper.create_exception(self.__exception_type, 'WLSDPLY-19106', path,
                                                   pwe.getLocalizedMessage(), error=pwe)
            self.__logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
            raise ex
 def _get_attributes_for_current_location_online(self, location):
     _method_name = '_get_attributes_for_current_location_online'
     attributes = dict()
     path = self._alias_helper.get_wlst_attributes_path(location)
     added = False
     try:
         attributes = wlst_helper.lsa(path)
         mbean_attributes = wlst_helper.get_mbi().getAttributes()
         if mbean_attributes:
             alias_attributes = self._get_wlst_attributes(location)
             for mbean_attribute in mbean_attributes:
                 name = mbean_attribute.getName()
                 if name not in attributes and name in alias_attributes:
                     attributes[name] = wlst_helper.get(name)
                     added = True
     except PyWLSTException, pe:
         name = location.get_model_folders()[-1]
         _logger.fine('WLSDPLY-06109', name, str(location), pe.getLocalizedMessage(), class_name=_class_name,
                      method_name=_method_name)
 def _get_attributes_for_current_location(self, location):
     """
     Change to the mbean folder with the provided name using the current location and return
     the attributes at that location.
     :param location: context with the current location information
     :return: list of attributes
     """
     _method_name = '_get_attributes_for_current_location'
     attributes = []
     path = self._alias_helper.get_wlst_attributes_path(location)
     try:
         attributes = wlst_helper.lsa(path)
     except PyWLSTException, pe:
         name = location.get_model_folders()[-1]
         _logger.fine('WLSDPLY-06109',
                      name,
                      str(location),
                      pe.getLocalizedMessage(),
                      class_name=_class_name,
                      method_name=_method_name)