)]}'
{"sushy/resources/base.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"0e547c1e1f0c1fc9eea3a6fcda1190a9ff0bc7bb","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    redfish_version \u003d None"},{"line_number":184,"context_line":"    \"\"\"The Redfish version\"\"\""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    __stale \u003d None"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    def __init__(self, connector, path\u003d\u0027\u0027, redfish_version\u003dNone):"},{"line_number":189,"context_line":"        \"\"\"A class representing the base of any Redfish resource"}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_f0882272","line":186,"updated":"2017-07-31 08:29:16.000000000","message":"s/None/False/","commit_id":"29e9bb783cb1f8be7aa667090642b96400e5898d"},{"author":{"_account_id":16635,"name":"deray","email":"debayan.ray@gmail.com","username":"deray"},"change_message_id":"8f3b6f84089c69359972acbd2e43bcfdac395ed5","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    redfish_version \u003d None"},{"line_number":184,"context_line":"    \"\"\"The Redfish version\"\"\""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    __stale \u003d None"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    def __init__(self, connector, path\u003d\u0027\u0027, redfish_version\u003dNone):"},{"line_number":189,"context_line":"        \"\"\"A class representing the base of any Redfish resource"}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_a9069585","line":186,"in_reply_to":"df3967d1_f0882272","updated":"2017-08-01 04:58:51.000000000","message":"changed it to:\n\n    is_stale \u003d False","commit_id":"29e9bb783cb1f8be7aa667090642b96400e5898d"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"0e547c1e1f0c1fc9eea3a6fcda1190a9ff0bc7bb","unresolved":false,"context_lines":[{"line_number":229,"context_line":""},{"line_number":230,"context_line":"    def is_stale(self):"},{"line_number":231,"context_line":"        \"\"\"Indicates if the resource holds stale data or not.\"\"\""},{"line_number":232,"context_line":"        return self.__stale is not None and self.__stale is True"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    @property"},{"line_number":235,"context_line":"    def json(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_d07d1e6f","line":232,"updated":"2017-07-31 08:29:16.000000000","message":"why not just use a public attribute? this whole indirection seems redundant","commit_id":"29e9bb783cb1f8be7aa667090642b96400e5898d"},{"author":{"_account_id":16635,"name":"deray","email":"debayan.ray@gmail.com","username":"deray"},"change_message_id":"8f3b6f84089c69359972acbd2e43bcfdac395ed5","unresolved":false,"context_lines":[{"line_number":229,"context_line":""},{"line_number":230,"context_line":"    def is_stale(self):"},{"line_number":231,"context_line":"        \"\"\"Indicates if the resource holds stale data or not.\"\"\""},{"line_number":232,"context_line":"        return self.__stale is not None and self.__stale is True"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    @property"},{"line_number":235,"context_line":"    def json(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_09f5a183","line":232,"in_reply_to":"df3967d1_d07d1e6f","updated":"2017-08-01 04:58:51.000000000","message":"Removed this part. And changed this to a public attribute named \u0027is_stale\u0027. See l186","commit_id":"29e9bb783cb1f8be7aa667090642b96400e5898d"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ad1e5e919ee9be65e3a117a0ed76b4ae3d243f76","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    redfish_version \u003d None"},{"line_number":184,"context_line":"    \"\"\"The Redfish version\"\"\""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    is_stale \u003d False"},{"line_number":187,"context_line":"    \"\"\"Indicates if the resource holds stale data or not.\"\"\""},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def __init__(self, connector, path\u003d\u0027\u0027, redfish_version\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f515b1d_8e1fff6a","line":186,"updated":"2017-10-09 16:01:23.000000000","message":"I\u0027d prefer we make this private and hide it behind refresh() and the new invalidate() call - see below","commit_id":"086de1bd3f656417c9b901b327b5fab2c852574e"},{"author":{"_account_id":16635,"name":"deray","email":"debayan.ray@gmail.com","username":"deray"},"change_message_id":"16816b587ced8966c5555134989139c9d4549c60","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    redfish_version \u003d None"},{"line_number":184,"context_line":"    \"\"\"The Redfish version\"\"\""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    is_stale \u003d False"},{"line_number":187,"context_line":"    \"\"\"Indicates if the resource holds stale data or not.\"\"\""},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def __init__(self, connector, path\u003d\u0027\u0027, redfish_version\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f4e5783_b1c28e84","line":186,"in_reply_to":"7f515b1d_8e1fff6a","updated":"2017-10-11 09:56:50.000000000","message":"Done","commit_id":"086de1bd3f656417c9b901b327b5fab2c852574e"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ad1e5e919ee9be65e3a117a0ed76b4ae3d243f76","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            # Hide the Field object behind the real value"},{"line_number":209,"context_line":"            setattr(self, attr, field._load(self.json, self))"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    def refresh(self):"},{"line_number":212,"context_line":"        \"\"\"Refresh the resource"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"        Freshly retrieves/fetches the resource attributes and invokes"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f515b1d_6e10435a","line":211,"updated":"2017-10-09 16:01:23.000000000","message":"I\u0027d also introduce \"force\" call that will force refresh an the resource and it subresources. so here\n\n def refresh(self, force\u003dFalse):","commit_id":"086de1bd3f656417c9b901b327b5fab2c852574e"},{"author":{"_account_id":16635,"name":"deray","email":"debayan.ray@gmail.com","username":"deray"},"change_message_id":"16816b587ced8966c5555134989139c9d4549c60","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            # Hide the Field object behind the real value"},{"line_number":209,"context_line":"            setattr(self, attr, field._load(self.json, self))"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    def refresh(self):"},{"line_number":212,"context_line":"        \"\"\"Refresh the resource"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"        Freshly retrieves/fetches the resource attributes and invokes"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f4e5783_91bf92fa","line":211,"in_reply_to":"7f515b1d_6e10435a","updated":"2017-10-11 09:56:50.000000000","message":"Done","commit_id":"086de1bd3f656417c9b901b327b5fab2c852574e"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ad1e5e919ee9be65e3a117a0ed76b4ae3d243f76","unresolved":false,"context_lines":[{"line_number":216,"context_line":"        :raises: ResourceNotFoundError"},{"line_number":217,"context_line":"        :raises: ConnectionError"},{"line_number":218,"context_line":"        :raises: HTTPError"},{"line_number":219,"context_line":"        \"\"\""},{"line_number":220,"context_line":"        self._json \u003d self._conn.get(path\u003dself._path).json()"},{"line_number":221,"context_line":"        LOG.debug(\u0027Received representation of %(type)s %(path)s: %(json)s\u0027,"},{"line_number":222,"context_line":"                  {\u0027type\u0027: self.__class__.__name__,"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f515b1d_4e158748","line":219,"updated":"2017-10-09 16:01:23.000000000","message":"and here:\n\n if not self.is_stale and not force:\n     return","commit_id":"086de1bd3f656417c9b901b327b5fab2c852574e"},{"author":{"_account_id":16635,"name":"deray","email":"debayan.ray@gmail.com","username":"deray"},"change_message_id":"16816b587ced8966c5555134989139c9d4549c60","unresolved":false,"context_lines":[{"line_number":216,"context_line":"        :raises: ResourceNotFoundError"},{"line_number":217,"context_line":"        :raises: ConnectionError"},{"line_number":218,"context_line":"        :raises: HTTPError"},{"line_number":219,"context_line":"        \"\"\""},{"line_number":220,"context_line":"        self._json \u003d self._conn.get(path\u003dself._path).json()"},{"line_number":221,"context_line":"        LOG.debug(\u0027Received representation of %(type)s %(path)s: %(json)s\u0027,"},{"line_number":222,"context_line":"                  {\u0027type\u0027: self.__class__.__name__,"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f4e5783_71bc1605","line":219,"in_reply_to":"7f515b1d_4e158748","updated":"2017-10-11 09:56:50.000000000","message":"Done","commit_id":"086de1bd3f656417c9b901b327b5fab2c852574e"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ad1e5e919ee9be65e3a117a0ed76b4ae3d243f76","unresolved":false,"context_lines":[{"line_number":223,"context_line":"                   \u0027path\u0027: self._path, \u0027json\u0027: self._json})"},{"line_number":224,"context_line":"        self._parse_attributes()"},{"line_number":225,"context_line":"        self.is_stale \u003d False"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"    @property"},{"line_number":228,"context_line":"    def json(self):"},{"line_number":229,"context_line":"        return self._json"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f515b1d_2e0ecb3a","line":226,"updated":"2017-10-09 16:01:23.000000000","message":"now a new addition\n\n def invalidate(self, force_refresh\u003dFalse):\n     self.is_stale \u003d True\n     if force_refresh:\n         self.refresh()\n\nsee below how it\u0027s going to be used","commit_id":"086de1bd3f656417c9b901b327b5fab2c852574e"},{"author":{"_account_id":16635,"name":"deray","email":"debayan.ray@gmail.com","username":"deray"},"change_message_id":"16816b587ced8966c5555134989139c9d4549c60","unresolved":false,"context_lines":[{"line_number":223,"context_line":"                   \u0027path\u0027: self._path, \u0027json\u0027: self._json})"},{"line_number":224,"context_line":"        self._parse_attributes()"},{"line_number":225,"context_line":"        self.is_stale \u003d False"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"    @property"},{"line_number":228,"context_line":"    def json(self):"},{"line_number":229,"context_line":"        return self._json"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f4e5783_313c5e92","line":226,"in_reply_to":"7f515b1d_2e0ecb3a","updated":"2017-10-11 09:56:50.000000000","message":"Done","commit_id":"086de1bd3f656417c9b901b327b5fab2c852574e"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"f66da03677957bfccc697ae4d6e2df576de34c76","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    redfish_version \u003d None"},{"line_number":184,"context_line":"    \"\"\"The Redfish version\"\"\""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    _is_stale \u003d True"},{"line_number":187,"context_line":"    \"\"\"Indicates if the resource holds stale data or not.\"\"\""},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def __init__(self, connector, path\u003d\u0027\u0027, redfish_version\u003dNone):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f4e5783_53ac4233","line":186,"updated":"2017-10-13 05:34:40.000000000","message":"So is it okay that this is a class level variable and not an object level variable?\n\nIs there only one object created from this class? I think I\u0027m not understanding this correctly.\n\nI guess I\u0027m thinking this should be in the __init__() method.","commit_id":"19e0336294358f5ef1efdba7ad3eb20fa89c8619"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"69ca3e7547909ee2c7861789add41125c9f06b52","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    redfish_version \u003d None"},{"line_number":184,"context_line":"    \"\"\"The Redfish version\"\"\""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    _is_stale \u003d True"},{"line_number":187,"context_line":"    \"\"\"Indicates if the resource holds stale data or not.\"\"\""},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def __init__(self, connector, path\u003d\u0027\u0027, redfish_version\u003dNone):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f4e5783_69205d49","line":186,"in_reply_to":"5f4e5783_1c7c92b3","updated":"2017-10-13 14:57:58.000000000","message":"I guess I still don\u0027t understand why don\u0027t put it in the self.__init__   As it is now it just seems a dangling unused variable.\n\n class Foo(object):\n     class_var \u003d 1\n\n     def __init__(self, value):\n         self.class_var \u003d value\n\n\n class Child(Foo):\n\n     def get_value(self):\n         print(\"instance: {}\".format(self.class_var))\n         print(\"Child.class_var: {}\".format(Child.class_var))\n         print(\"Foo.class_var: {}\".format(Foo.class_var))\n\n\n a \u003d Child(23)\n b \u003d Child(12)\n\n a.get_value()\n b.get_value()","commit_id":"19e0336294358f5ef1efdba7ad3eb20fa89c8619"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"29a2dbbd3ec4fbcc19af8c8d52e5f78f00f6ec9b","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    redfish_version \u003d None"},{"line_number":184,"context_line":"    \"\"\"The Redfish version\"\"\""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    _is_stale \u003d True"},{"line_number":187,"context_line":"    \"\"\"Indicates if the resource holds stale data or not.\"\"\""},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def __init__(self, connector, path\u003d\u0027\u0027, redfish_version\u003dNone):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f4e5783_61fa84bd","line":186,"in_reply_to":"5f4e5783_3ba8468a","updated":"2017-10-16 15:36:05.000000000","message":"I guess I would rather it be set like in line 201. Less confusing, less cognitive load for people.\n\nCan just do:\n\n self._is_stale \u003d True\n\nin the __init__() below and it does the same as what is currently being done.\n\nI would like to see what other people think.","commit_id":"19e0336294358f5ef1efdba7ad3eb20fa89c8619"},{"author":{"_account_id":16635,"name":"deray","email":"debayan.ray@gmail.com","username":"deray"},"change_message_id":"a4688d6aa15f6a83721de0d7acf4959012484f24","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    redfish_version \u003d None"},{"line_number":184,"context_line":"    \"\"\"The Redfish version\"\"\""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    _is_stale \u003d True"},{"line_number":187,"context_line":"    \"\"\"Indicates if the resource holds stale data or not.\"\"\""},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def __init__(self, connector, path\u003d\u0027\u0027, redfish_version\u003dNone):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f4e5783_1c7c92b3","line":186,"in_reply_to":"5f4e5783_53ac4233","updated":"2017-10-13 10:10:38.000000000","message":"\u003e So is it okay that this is a class level variable and not an object level variable?\n\nActually it\u0027s supposed to be an object level var. But for the first time check when the instance gets created this class level variable has been placed. See where for any instance the first time when it is created it checks for the class level var value here: https://review.openstack.org/#/c/485799/4/sushy/resources/base.py@228 and the next time onwards when it comes to ``refresh`` the instance level var is checked. Does that clarify the doubt?\n\n \u003e Is there only one object created from this class?\n\nNo\n\n \u003e I guess I\u0027m thinking this should be in the __init__() method.\n\nJust for the initial check I have put this as the class level var and the var doesn\u0027t get modified at any point. The instance level var is set at: https://review.openstack.org/#/c/485799/4/sushy/resources/base.py@239","commit_id":"19e0336294358f5ef1efdba7ad3eb20fa89c8619"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"c701a55b9d10dcdc813084ad3549cf85edd0e71d","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    redfish_version \u003d None"},{"line_number":184,"context_line":"    \"\"\"The Redfish version\"\"\""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    _is_stale \u003d True"},{"line_number":187,"context_line":"    \"\"\"Indicates if the resource holds stale data or not.\"\"\""},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def __init__(self, connector, path\u003d\u0027\u0027, redfish_version\u003dNone):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f4e5783_73481986","line":186,"in_reply_to":"5f4e5783_61fa84bd","updated":"2017-10-16 17:46:09.000000000","message":"So we had a discussion in IRC about this:\n\nhttp://eavesdrop.openstack.org/irclogs/%23openstack-meeting-3/%23openstack-meeting-3.2017-10-16.log.html#t2017-10-16T17:36:26-2","commit_id":"19e0336294358f5ef1efdba7ad3eb20fa89c8619"},{"author":{"_account_id":16635,"name":"deray","email":"debayan.ray@gmail.com","username":"deray"},"change_message_id":"7f85ecb4f85866cd6eeef688fc20e8535e687c86","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    redfish_version \u003d None"},{"line_number":184,"context_line":"    \"\"\"The Redfish version\"\"\""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    _is_stale \u003d True"},{"line_number":187,"context_line":"    \"\"\"Indicates if the resource holds stale data or not.\"\"\""},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def __init__(self, connector, path\u003d\u0027\u0027, redfish_version\u003dNone):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f4e5783_3ba8468a","line":186,"in_reply_to":"5f4e5783_69205d49","updated":"2017-10-16 09:47:11.000000000","message":"I fully understand the dangling nature of the class variable in your example. But, it\u0027s not just only setting that variable here, I also intend to check the value of it (class variable) before assigning it (instance variable). So, inherently it would be something like:\n\n    class Foo(object):\n      some_var \u003d some_val\n\n      def __init__(self, value):\n        refresh()\n\n      def refresh(self):\n\t# checks for class level var first time,\n        # instance level var next time onwards.\n        if self.some_var \u003d\u003d some_val:\n          ...  # some action\n\n        ...  # some more action\n        self.some_var \u003d value\n\nI keep that attribute as class level one because it is the same for all instances (also doesn\u0027t intend to modify). I could have formulated the same thing in the following manner:\n\n    class Foo(object):\n\n      def __init__(self, value):\n\tself.some_var \u003d some_val\n        refresh()\n\n      ... # rest same\n\nbut I think it\u0027s matter of choice. If you really see any value in the 2nd one compared to the 1st one, I am ready to change. I am also open to any other suggestion based on my requirement.","commit_id":"19e0336294358f5ef1efdba7ad3eb20fa89c8619"},{"author":{"_account_id":16635,"name":"deray","email":"debayan.ray@gmail.com","username":"deray"},"change_message_id":"7e8cf19a75b0707e08bd1c5d1437e80dae3dae6e","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    redfish_version \u003d None"},{"line_number":184,"context_line":"    \"\"\"The Redfish version\"\"\""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    _is_stale \u003d True"},{"line_number":187,"context_line":"    \"\"\"Indicates if the resource holds stale data or not.\"\"\""},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def __init__(self, connector, path\u003d\u0027\u0027, redfish_version\u003dNone):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f4e5783_6c44ab47","line":186,"in_reply_to":"5f4e5783_73481986","updated":"2017-10-17 07:05:40.000000000","message":"\u003e So we had a discussion in IRC about this: http://eavesdrop.openstack.org/irclogs/%23openstack-meeting-3/%23openstack-meeting-3.2017-10-16.log.html#t2017-10-16T17:36:26-2\n\nThank you John for bringing up this in IRC. As earlier said I am fine with amending that to include inside __init__(). Will submit a new patch-set with the changes soon.","commit_id":"19e0336294358f5ef1efdba7ad3eb20fa89c8619"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"7551830854c9f52bd072c57633c05e80daf52af6","unresolved":false,"context_lines":[{"line_number":184,"context_line":"    \"\"\"The Redfish version\"\"\""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    _is_stale \u003d True"},{"line_number":187,"context_line":"    \"\"\"Indicates if the resource holds stale data or not.\"\"\""},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def __init__(self, connector, path\u003d\u0027\u0027, redfish_version\u003dNone):"},{"line_number":190,"context_line":"        \"\"\"A class representing the base of any Redfish resource"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f4e5783_53619d04","line":187,"updated":"2017-10-16 17:50:49.000000000","message":"John brought this up in today\u0027s weekly meeting. I think this is somewhat wrong, regardless of the fact that \u0027it works\u0027. What is the diff between this _is_stale, and eg adding _conn, _path, _json?\n\nUnless you have a need to refer to the class\u0027 eg ResourceBase._is_stale, there is no need to have this. If the only time you use it, is in reference to an instance of this object, it should just be that object\u0027s variable, not a class level one.\n\nThe only other reason for having it, maybe, is if you envision some subclass of ResourceBase that might want it set by default to False instead of True.\n\nGiven that John has reviewed it and finds it confusing, others may also find it confusing, and we would like code to be easily understood to make it easier to maintain and update in the future.","commit_id":"19e0336294358f5ef1efdba7ad3eb20fa89c8619"},{"author":{"_account_id":16635,"name":"deray","email":"debayan.ray@gmail.com","username":"deray"},"change_message_id":"7e8cf19a75b0707e08bd1c5d1437e80dae3dae6e","unresolved":false,"context_lines":[{"line_number":184,"context_line":"    \"\"\"The Redfish version\"\"\""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    _is_stale \u003d True"},{"line_number":187,"context_line":"    \"\"\"Indicates if the resource holds stale data or not.\"\"\""},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def __init__(self, connector, path\u003d\u0027\u0027, redfish_version\u003dNone):"},{"line_number":190,"context_line":"        \"\"\"A class representing the base of any Redfish resource"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f4e5783_ec71bba9","line":187,"in_reply_to":"5f4e5783_53619d04","updated":"2017-10-17 07:05:40.000000000","message":"Thanks Ruby for sharing your views.\n\n \u003e What is the diff between this _is_stale, and eg adding _conn, _path, _json?\n\nAgree that there\u0027s no difference. Again, going by the same argument there\u0027s also no difference with declaration of ``redfish_version`` here: https://review.openstack.org/#/c/485799/4/sushy/resources/base.py@183. Moreover, as a matter of fact there are also some more incidental occurrences of similar formings like:\n\nhttps://github.com/openstack/sushy/blob/master/sushy/resources/system/system.py#L118\n\nhttps://github.com/openstack/sushy/blob/master/sushy/resources/system/system.py#L122\n\nShould I go ahead and amend them as well?\n\n \u003e Unless you have a need to refer to the class\u0027 eg ResourceBase._is_stale, there is no need to have this. If the only time you use it, is in reference to an instance of this object, it should just be that object\u0027s variable, not a class level one. The only other reason for having it, maybe, is if you envision some subclass of ResourceBase that might want it set by default to False instead of True.\n\nYeah, you are correct. Also I don\u0027t envision any subclass of ResourceBase to change the default value. Hence makes it (more) appropriate to add as instance variable.\n\n \u003e Given that John has reviewed it and finds it confusing, others may also find it confusing, and we would like code to be easily understood to make it easier to maintain and update in the future.\n\nyes, perfectly makes sense.","commit_id":"19e0336294358f5ef1efdba7ad3eb20fa89c8619"},{"author":{"_account_id":16635,"name":"deray","email":"debayan.ray@gmail.com","username":"deray"},"change_message_id":"3aa5d30409016ef2b20c8e030ab66e166fec5695","unresolved":false,"context_lines":[{"line_number":184,"context_line":"    \"\"\"The Redfish version\"\"\""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    _is_stale \u003d True"},{"line_number":187,"context_line":"    \"\"\"Indicates if the resource holds stale data or not.\"\"\""},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def __init__(self, connector, path\u003d\u0027\u0027, redfish_version\u003dNone):"},{"line_number":190,"context_line":"        \"\"\"A class representing the base of any Redfish resource"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f4e5783_8710c601","line":187,"in_reply_to":"5f4e5783_8b27c3ca","updated":"2017-10-17 21:46:02.000000000","message":"\u003e Thanks for making the change. wrt the other places -- I am not familiar with sushy and don\u0027t have time to look into it, so will let others comment.\n\nNever mind.\n\n\u003e Regardless, please do not change them in this patch, unless this patch has added them.\n\nyes, of course!","commit_id":"19e0336294358f5ef1efdba7ad3eb20fa89c8619"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"d948be8809caa697d904291d88269306539b3f75","unresolved":false,"context_lines":[{"line_number":184,"context_line":"    \"\"\"The Redfish version\"\"\""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    _is_stale \u003d True"},{"line_number":187,"context_line":"    \"\"\"Indicates if the resource holds stale data or not.\"\"\""},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def __init__(self, connector, path\u003d\u0027\u0027, redfish_version\u003dNone):"},{"line_number":190,"context_line":"        \"\"\"A class representing the base of any Redfish resource"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f4e5783_8b27c3ca","line":187,"in_reply_to":"5f4e5783_ec71bba9","updated":"2017-10-17 13:13:46.000000000","message":"Thanks for making the change. wrt the other places -- I am not familiar with sushy and don\u0027t have time to look into it, so will let others comment. Regardless, please do not change them in this patch, unless this patch has added them.","commit_id":"19e0336294358f5ef1efdba7ad3eb20fa89c8619"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"bcf5232fedd3bd0cd6dac1391b31633a95451766","unresolved":false,"context_lines":[{"line_number":215,"context_line":""},{"line_number":216,"context_line":"        Freshly retrieves/fetches the resource attributes and invokes"},{"line_number":217,"context_line":"        ``_parse_attributes()`` method on successful retrieval."},{"line_number":218,"context_line":"        Advised not to override this method in concrete ResourceBase classes."},{"line_number":219,"context_line":"        Resource classes can place their refresh specific operations in"},{"line_number":220,"context_line":"        ``_do_refresh()`` method, if needed. This method represents the"},{"line_number":221,"context_line":"        template method in the paradigm of Template design pattern."}],"source_content_type":"text/x-python","patch_set":6,"id":"ff82abbf_8a6aa1b0","line":218,"updated":"2017-11-23 13:58:22.000000000","message":"nit: s/Advised/It is recommended/","commit_id":"2b39751e193c56995bbb95741afcdabc8bccdb05"},{"author":{"_account_id":16635,"name":"deray","email":"debayan.ray@gmail.com","username":"deray"},"change_message_id":"7d96fdec4068c019cda43d0505f2e44d3d70273f","unresolved":false,"context_lines":[{"line_number":215,"context_line":""},{"line_number":216,"context_line":"        Freshly retrieves/fetches the resource attributes and invokes"},{"line_number":217,"context_line":"        ``_parse_attributes()`` method on successful retrieval."},{"line_number":218,"context_line":"        Advised not to override this method in concrete ResourceBase classes."},{"line_number":219,"context_line":"        Resource classes can place their refresh specific operations in"},{"line_number":220,"context_line":"        ``_do_refresh()`` method, if needed. This method represents the"},{"line_number":221,"context_line":"        template method in the paradigm of Template design pattern."}],"source_content_type":"text/x-python","patch_set":6,"id":"9f91af0f_79fdf438","line":218,"in_reply_to":"9f91af0f_a7f28905","updated":"2018-01-03 09:02:51.000000000","message":"Raised a separate one: https://review.openstack.org/#/c/530872/","commit_id":"2b39751e193c56995bbb95741afcdabc8bccdb05"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"6439ff1ec5bd28ba6554978ce83fe9865c1e118c","unresolved":false,"context_lines":[{"line_number":215,"context_line":""},{"line_number":216,"context_line":"        Freshly retrieves/fetches the resource attributes and invokes"},{"line_number":217,"context_line":"        ``_parse_attributes()`` method on successful retrieval."},{"line_number":218,"context_line":"        Advised not to override this method in concrete ResourceBase classes."},{"line_number":219,"context_line":"        Resource classes can place their refresh specific operations in"},{"line_number":220,"context_line":"        ``_do_refresh()`` method, if needed. This method represents the"},{"line_number":221,"context_line":"        template method in the paradigm of Template design pattern."}],"source_content_type":"text/x-python","patch_set":6,"id":"9f91af0f_a7f28905","line":218,"in_reply_to":"ff82abbf_8a6aa1b0","updated":"2018-01-02 14:12:22.000000000","message":"+1","commit_id":"2b39751e193c56995bbb95741afcdabc8bccdb05"}],"sushy/resources/system/system.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"0e547c1e1f0c1fc9eea3a6fcda1190a9ff0bc7bb","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        return self._processors"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"    def refresh(self):"},{"line_number":267,"context_line":"        super(System, self).refresh()"},{"line_number":268,"context_line":"        if self._processors is not None:"},{"line_number":269,"context_line":"            self._processors.stale()"},{"line_number":270,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_b0829a4e","line":267,"updated":"2017-07-31 08:29:16.000000000","message":"really, this should be just\n\n self._processors.stale \u003d True","commit_id":"29e9bb783cb1f8be7aa667090642b96400e5898d"},{"author":{"_account_id":16635,"name":"deray","email":"debayan.ray@gmail.com","username":"deray"},"change_message_id":"62c7d5e7748ac830ed8b213342cdf373c3b0cbe4","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        return self._processors"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"    def refresh(self):"},{"line_number":267,"context_line":"        super(System, self).refresh()"},{"line_number":268,"context_line":"        if self._processors is not None:"},{"line_number":269,"context_line":"            self._processors.stale()"},{"line_number":270,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_0c0ecf31","line":267,"in_reply_to":"df3967d1_b0829a4e","updated":"2017-08-01 05:05:37.000000000","message":"I simply cannot do just that as the initial value to _processors is None. Hence, need to do something of this sort:\n\n    def refresh(self):\n      super(System, self).refresh()\n      if self._processors is not None:\n        self._processors.is_stale \u003d True\n\n\nThe reason for the check is take care of the first time ``refresh`` call which happens at the initialization of any resource.","commit_id":"29e9bb783cb1f8be7aa667090642b96400e5898d"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"0e547c1e1f0c1fc9eea3a6fcda1190a9ff0bc7bb","unresolved":false,"context_lines":[{"line_number":266,"context_line":"    def refresh(self):"},{"line_number":267,"context_line":"        super(System, self).refresh()"},{"line_number":268,"context_line":"        if self._processors is not None:"},{"line_number":269,"context_line":"            self._processors.stale()"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"class SystemCollection(base.ResourceCollectionBase):"}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_90979691","line":269,"updated":"2017-07-31 08:29:16.000000000","message":"++","commit_id":"29e9bb783cb1f8be7aa667090642b96400e5898d"},{"author":{"_account_id":11076,"name":"Shivanand Tendulker","email":"stendulker@gmail.com","username":"stendulker"},"change_message_id":"8c3e969d154b8e459ad68bfcbfbddc1c3a598b80","unresolved":false,"context_lines":[{"line_number":265,"context_line":""},{"line_number":266,"context_line":"    def refresh(self):"},{"line_number":267,"context_line":"        super(System, self).refresh()"},{"line_number":268,"context_line":"        if self._processors is not None:"},{"line_number":269,"context_line":"            self._processors.stale()"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"class SystemCollection(base.ResourceCollectionBase):"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff346bd7_23b1d590","line":269,"range":{"start_line":268,"start_character":8,"end_line":269,"end_character":36},"updated":"2017-07-22 13:06:57.000000000","message":"This would help if the user knows if he could consume the stale data. But there is no information available to know whether \u0027stale\u0027 data is good enough for consumption or he should refresh. \nIn the absence of data to determine if he can consume stale data, this would cause him to write extra code to avoid stale data and invoke refresh().\n\nEarlier:-\n---------\nsys_inst \u003d system.System(...)\nsys_inst.refresh()\nsummary \u003d sys_inst.processors().summary \u003c\u003c- This would get refreshed data\n\n\nProposed:-\n----------\nsys_inst \u003d system.System(...)\nsys_inst.refresh()\n\nsys_inst.processors().is_stale():  \u003c\u003c- Additional call\n    sys_inst.processors().refresh()   \u003c\u003c- Additional call\n\nsummary \u003d sys_inst.processors().summary","commit_id":"29e9bb783cb1f8be7aa667090642b96400e5898d"},{"author":{"_account_id":11076,"name":"Shivanand Tendulker","email":"stendulker@gmail.com","username":"stendulker"},"change_message_id":"ed7c811c1ef7498d4c99f3d7a0d4956168571794","unresolved":false,"context_lines":[{"line_number":265,"context_line":""},{"line_number":266,"context_line":"    def refresh(self):"},{"line_number":267,"context_line":"        super(System, self).refresh()"},{"line_number":268,"context_line":"        if self._processors is not None:"},{"line_number":269,"context_line":"            self._processors.stale()"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"class SystemCollection(base.ResourceCollectionBase):"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff346bd7_56cfeb7e","line":269,"range":{"start_line":268,"start_character":8,"end_line":269,"end_character":36},"in_reply_to":"ff346bd7_23b1d590","updated":"2017-07-24 03:12:15.000000000","message":"Ah, in system.refresh() would take care of refershing the system._processors . It looks fine to me.","commit_id":"29e9bb783cb1f8be7aa667090642b96400e5898d"},{"author":{"_account_id":16635,"name":"deray","email":"debayan.ray@gmail.com","username":"deray"},"change_message_id":"a8b68f86519f65e7842f65b9c72603da256474fe","unresolved":false,"context_lines":[{"line_number":265,"context_line":""},{"line_number":266,"context_line":"    def refresh(self):"},{"line_number":267,"context_line":"        super(System, self).refresh()"},{"line_number":268,"context_line":"        if self._processors is not None:"},{"line_number":269,"context_line":"            self._processors.stale()"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"class SystemCollection(base.ResourceCollectionBase):"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff346bd7_56d00bf8","line":269,"range":{"start_line":268,"start_character":8,"end_line":269,"end_character":36},"in_reply_to":"ff346bd7_56cfeb7e","updated":"2017-07-24 03:27:22.000000000","message":"++ :)","commit_id":"29e9bb783cb1f8be7aa667090642b96400e5898d"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ad1e5e919ee9be65e3a117a0ed76b4ae3d243f76","unresolved":false,"context_lines":[{"line_number":259,"context_line":"                redfish_version\u003dself.redfish_version)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"        if self._processors.is_stale:"},{"line_number":262,"context_line":"            self._processors.refresh()"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"        return self._processors"},{"line_number":265,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7f515b1d_0e0b0f2a","line":262,"updated":"2017-10-09 16:01:23.000000000","message":"just self._processors.refresh(force\u003dFalse)","commit_id":"086de1bd3f656417c9b901b327b5fab2c852574e"},{"author":{"_account_id":16635,"name":"deray","email":"debayan.ray@gmail.com","username":"deray"},"change_message_id":"16816b587ced8966c5555134989139c9d4549c60","unresolved":false,"context_lines":[{"line_number":259,"context_line":"                redfish_version\u003dself.redfish_version)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"        if self._processors.is_stale:"},{"line_number":262,"context_line":"            self._processors.refresh()"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"        return self._processors"},{"line_number":265,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f4e5783_915432cc","line":262,"in_reply_to":"7f515b1d_0e0b0f2a","updated":"2017-10-11 09:56:50.000000000","message":"Done","commit_id":"086de1bd3f656417c9b901b327b5fab2c852574e"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ad1e5e919ee9be65e3a117a0ed76b4ae3d243f76","unresolved":false,"context_lines":[{"line_number":263,"context_line":""},{"line_number":264,"context_line":"        return self._processors"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"    def refresh(self):"},{"line_number":267,"context_line":"        super(System, self).refresh()"},{"line_number":268,"context_line":"        if self._processors is not None:"},{"line_number":269,"context_line":"            self._processors.is_stale \u003d True"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f515b1d_ee03130f","line":266,"updated":"2017-10-09 16:01:23.000000000","message":"this turns into\n\n def refresh(self, force\u003dFalse)","commit_id":"086de1bd3f656417c9b901b327b5fab2c852574e"},{"author":{"_account_id":16635,"name":"deray","email":"debayan.ray@gmail.com","username":"deray"},"change_message_id":"16816b587ced8966c5555134989139c9d4549c60","unresolved":false,"context_lines":[{"line_number":263,"context_line":""},{"line_number":264,"context_line":"        return self._processors"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"    def refresh(self):"},{"line_number":267,"context_line":"        super(System, self).refresh()"},{"line_number":268,"context_line":"        if self._processors is not None:"},{"line_number":269,"context_line":"            self._processors.is_stale \u003d True"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f4e5783_7151b6d8","line":266,"in_reply_to":"7f515b1d_ee03130f","updated":"2017-10-11 09:56:50.000000000","message":"Done","commit_id":"086de1bd3f656417c9b901b327b5fab2c852574e"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ad1e5e919ee9be65e3a117a0ed76b4ae3d243f76","unresolved":false,"context_lines":[{"line_number":266,"context_line":"    def refresh(self):"},{"line_number":267,"context_line":"        super(System, self).refresh()"},{"line_number":268,"context_line":"        if self._processors is not None:"},{"line_number":269,"context_line":"            self._processors.is_stale \u003d True"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"class SystemCollection(base.ResourceCollectionBase):"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f515b1d_ce005705","line":269,"updated":"2017-10-09 16:01:23.000000000","message":"and this becomes\n\n self.invalidate(force_refresh\u003dforce)","commit_id":"086de1bd3f656417c9b901b327b5fab2c852574e"},{"author":{"_account_id":16635,"name":"deray","email":"debayan.ray@gmail.com","username":"deray"},"change_message_id":"16816b587ced8966c5555134989139c9d4549c60","unresolved":false,"context_lines":[{"line_number":266,"context_line":"    def refresh(self):"},{"line_number":267,"context_line":"        super(System, self).refresh()"},{"line_number":268,"context_line":"        if self._processors is not None:"},{"line_number":269,"context_line":"            self._processors.is_stale \u003d True"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"class SystemCollection(base.ResourceCollectionBase):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f4e5783_31d8de51","line":269,"in_reply_to":"7f515b1d_ce005705","updated":"2017-10-11 09:56:50.000000000","message":"do you mean to say?\n\n    self._processors.invalidate(force_refresh\u003dforce)","commit_id":"086de1bd3f656417c9b901b327b5fab2c852574e"}]}
