Danek,

In packagemanager.py you don't change the call to api.ImageInterface:

        @staticmethod
        def __get_api_object(img_dir, progtrack):
                api_o = None
                try:
                        api_o = api.ImageInterface(img_dir, \
                            CLIENT_API_VERSION, \
                            progtrack, None, PKG_CLIENT_NAME)
                except (api_errors.VersionException,\
                    api_errors.ImageNotFoundException):
                        raise
                return api_o

But do change it in updatemanager.py:

 743  746          def __get_api_obj(self):
 744  747                  if self.api_obj != None:
 745  748                          return self.api_obj
 746  749                  try:
 747      -                        self.api_obj = 
api.ImageInterface(self.__get_image_path(), \
 748      -                                CLIENT_API_VERSION, self.pr, 
self.__set_cancel_state, \
      750 +                        self.api_obj = 
api.ImageInterface(self.__get_image_path(),
      751 +                                CLIENT_API_VERSION, self.pr, 
self.__set_cancel_state,
 749  752                                  PKG_CLIENT_NAME)


In image.py there is a workaround to avoid caching will this still work 
as I see in api.py you remove the point where this was being set. Looks 
like its being setup in the history.py object now using the global 
settings but just wanted to check given the recent memory issues folks 
are raising, thanks:

        def get_manifest(self, fmri, filtered = False):
                """Find on-disk manifest and create in-memory Manifest
                object, applying appropriate filters as needed."""

                # XXX This is a temporary workaround so that GUI api 
consumsers
                # are not negatively impacted by manifest caching.  This 
should
                # be removed by bug 4231 whenever a better way to handle 
caching
                # is found.
                if self.history.client_name == "pkg":
                        if fmri in self.__manifest_cache:
                                m = self.__manifest_cache[fmri]
                        else:
                                m = self.__get_manifest(fmri)
                                self.__manifest_cache[fmri] = m
                else:
                        m = self.__get_manifest(fmri)

Danek Duvall wrote:
> On Fri, Nov 07, 2008 at 03:09:08PM -0800, Danek Duvall wrote:
>
>   
>>     http://cr.opensolaris.org/~dduvall/pkg-useragent/
>>     
>
> I noticed that a range of tests were failing due to this change (history
> was asserting that client_name was None), and went for what seemed to be
> both an expedient and correct solution.  The webrev is updated in place
> above, but the gist is that in setup_environment() in testutils.py, I
> import global_settings and set client_name to "pkg".
>
> Brock, if you could confirm that seems right to you, I'll go ahead and push
> the change.
>
> Thanks,
> Danek
> _______________________________________________
> pkg-discuss mailing list
> [email protected]
> http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
>   

_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to