Code review comment for lp://staging/~gary-lasker/software-center/update-to-latest-recommender-client

Revision history for this message
Michael Vogt (mvo) wrote :

On Mon, Aug 27, 2012 at 09:20:29PM -0000, Gary Lasker wrote:
> Gary Lasker has proposed merging lp:~gary-lasker/software-center/update-to-latest-recommender-client into lp:software-center.

Thanks for your branch, that looks good. A small test would be good,
to ensure to not break this again in some future refactor. Should we
as simply as:

def test_uuid_conversion(self):
  self.config.recommender_uuid = "xx-yy-zz"
  self.assertEqual(self.config.recommender_uuid, "xxyyzz")

[..]
> === modified file 'softwarecenter/backend/recagent.py'
> --- softwarecenter/backend/recagent.py 2012-08-15 11:21:05 +0000
> +++ softwarecenter/backend/recagent.py 2012-08-27 21:19:21 +0000
> @@ -123,7 +123,7 @@
> if not recommender_uuid:
> # generate a new uuid, but do not save it yet, this will
> # be done later in _on_submit_profile_data
> - recommender_uuid = get_uuid()
> + recommender_uuid = get_uuid().replace("-", "")

My gut feeling is that the get_uuid() call should do the replace,
maybe as a new generate_recommender_uuid() call? Just so that its all
in one place. So that if the call is re-used there is no suprise that
the result is different from what the recommender agent expects.

Cheers,
 Michael

« Back to merge proposal