Mercurial > p > roundup > code
comparison roundup/rest.py @ 5987:ea3485c67f94
Sort accept keys to make p2 and p3 ordering the same
Sort keys of self.__accepted_content_type. Keys returned in different
orders in python2/3. Sorting makes testing easier.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Tue, 26 Nov 2019 20:47:34 -0500 |
| parents | 25a813415d59 |
| children | 776ca681f925 |
comparison
equal
deleted
inserted
replaced
| 5986:8b88fb789208 | 5987:ea3485c67f94 |
|---|---|
| 1985 # error out before doing any work if we can't | 1985 # error out before doing any work if we can't |
| 1986 # display acceptable output. | 1986 # display acceptable output. |
| 1987 self.client.response_code = 406 | 1987 self.client.response_code = 406 |
| 1988 output = ( "Requested content type '%s' is not available.\n" | 1988 output = ( "Requested content type '%s' is not available.\n" |
| 1989 "Acceptable types: %s"%(data_type, | 1989 "Acceptable types: %s"%(data_type, |
| 1990 ", ".join(self.__accepted_content_type.keys()))) | 1990 ", ".join(sorted(self.__accepted_content_type.keys())))) |
| 1991 | 1991 |
| 1992 # Make output json end in a newline to | 1992 # Make output json end in a newline to |
| 1993 # separate from following text in logs etc.. | 1993 # separate from following text in logs etc.. |
| 1994 return bs2b(output + "\n") | 1994 return bs2b(output + "\n") |
| 1995 | 1995 |
