)]}'
{"doc/source/user/dynamic-emulator.rst":[{"author":{"_account_id":23851,"name":"Riccardo Pittau","email":"elfosardo@gmail.com","username":"elfosardo"},"change_message_id":"79e9b936a311cb848d517bb03977ca1956761a5e","unresolved":false,"context_lines":[{"line_number":346,"context_line":""},{"line_number":347,"context_line":"By default, *VirtualMedia* resource includes two emulated removable"},{"line_number":348,"context_line":"devices: *Cd* and *Floppy*. Each *Manager* resource gets its own collection"},{"line_number":349,"context_line":"of virtual media devices as a *VirtualMedia* ssub-resource."},{"line_number":350,"context_line":""},{"line_number":351,"context_line":"If currently used *Systems* resource emulation driver supports setting"},{"line_number":352,"context_line":"boot image, *VirtualMedia* resource will apply inserted image onto"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dfbec78f_61fa1f43","line":349,"range":{"start_line":349,"start_character":45,"end_line":349,"end_character":58},"updated":"2019-05-07 12:49:01.000000000","message":"s/ssub-resource/sub-resource","commit_id":"5c8602e61bdd412a32c15788c34ee7871d925074"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"61b82986ae707932cc389f0784d69c29ec584bbe","unresolved":false,"context_lines":[{"line_number":346,"context_line":""},{"line_number":347,"context_line":"By default, *VirtualMedia* resource includes two emulated removable"},{"line_number":348,"context_line":"devices: *Cd* and *Floppy*. Each *Manager* resource gets its own collection"},{"line_number":349,"context_line":"of virtual media devices as a *VirtualMedia* ssub-resource."},{"line_number":350,"context_line":""},{"line_number":351,"context_line":"If currently used *Systems* resource emulation driver supports setting"},{"line_number":352,"context_line":"boot image, *VirtualMedia* resource will apply inserted image onto"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dfbec78f_ab954de6","line":349,"range":{"start_line":349,"start_character":45,"end_line":349,"end_character":58},"in_reply_to":"dfbec78f_61fa1f43","updated":"2019-05-07 18:08:58.000000000","message":"Done","commit_id":"5c8602e61bdd412a32c15788c34ee7871d925074"}],"sushy_tools/emulator/main.py":[{"author":{"_account_id":23851,"name":"Riccardo Pittau","email":"elfosardo@gmail.com","username":"elfosardo"},"change_message_id":"79e9b936a311cb848d517bb03977ca1956761a5e","unresolved":false,"context_lines":[{"line_number":30,"context_line":"from sushy_tools import error"},{"line_number":31,"context_line":"from sushy_tools.error import FishyError"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"import flask"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"app \u003d flask.Flask(__name__)"},{"line_number":36,"context_line":"# Turn off strict_slashes on all routes"}],"source_content_type":"text/x-python","patch_set":12,"id":"dfbec78f_313798e6","line":33,"updated":"2019-05-07 12:49:01.000000000","message":"I know it\u0027s not related to this change, but this should go up before the imports from sushy_tools as this is a third imported library","commit_id":"5c8602e61bdd412a32c15788c34ee7871d925074"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"61b82986ae707932cc389f0784d69c29ec584bbe","unresolved":false,"context_lines":[{"line_number":30,"context_line":"from sushy_tools import error"},{"line_number":31,"context_line":"from sushy_tools.error import FishyError"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"import flask"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"app \u003d flask.Flask(__name__)"},{"line_number":36,"context_line":"# Turn off strict_slashes on all routes"}],"source_content_type":"text/x-python","patch_set":12,"id":"dfbec78f_4b84d1b1","line":33,"in_reply_to":"dfbec78f_313798e6","updated":"2019-05-07 18:08:58.000000000","message":"Done","commit_id":"5c8602e61bdd412a32c15788c34ee7871d925074"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"d72ffb20f15789eea6024c05164e969f09dcf251","unresolved":false,"context_lines":[{"line_number":374,"context_line":""},{"line_number":375,"context_line":"        for system in resources.systems.systems:"},{"line_number":376,"context_line":"            try:"},{"line_number":377,"context_line":"                resources.systems.set_boot_image("},{"line_number":378,"context_line":"                    system, device, boot_image\u003dimage_path,"},{"line_number":379,"context_line":"                    write_protected\u003dwrite_protected)"},{"line_number":380,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"dfbec78f_1872557c","line":377,"updated":"2019-05-13 15:33:24.000000000","message":"This is exactly one of the reasons I hate this whole patch chain: you\u0027re calling into System to do the actual work. There is no Manager resource in reality, you\u0027re forcing the operator to make it up for you. And I\u0027m firmly -1 on that.","commit_id":"35028de8f3efd25ff3d54f20bdc2c6378afb1508"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"c62bc7910dd261e9ab868bc08daa4354fe5e2b70","unresolved":false,"context_lines":[{"line_number":374,"context_line":""},{"line_number":375,"context_line":"        for system in resources.systems.systems:"},{"line_number":376,"context_line":"            try:"},{"line_number":377,"context_line":"                resources.systems.set_boot_image("},{"line_number":378,"context_line":"                    system, device, boot_image\u003dimage_path,"},{"line_number":379,"context_line":"                    write_protected\u003dwrite_protected)"},{"line_number":380,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"dfbec78f_7ed49920","line":377,"in_reply_to":"dfbec78f_1872557c","updated":"2019-05-13 17:18:37.000000000","message":"Right, we have discussed that in other patches.\n\nTo reiterate: this is exactly how Redfish puts things together. Managers \"own\" the drives and hand them over to Systems they manage to boot from. I agree that may seem counterintuitive, but that\u0027s how it is. In this patch chain I am trying to follow this Redfish model because I think that otherwise we won\u0027t be able to emulate other resources.\n\nPerhaps this is the point of contention - you are arguing that we should put everything into the systems driver (specifically, into libvirt) because this is what we actually use for systems emulation. I think I am not convinced and these are my counterarguments.\n\nYou pointed out that Systems and Managers are not orthogonal therefore we should not have dedicated drivers to emulate them. I think they are actually orthogonal and not tightly coupled e.g. you can have X Systems and Y Managers where Y \u003e 0.\n\nI think that other resources emerge that we need to emulate, in the light of that systems driver does not seem to be a good fit... Consider the indicator resource - if we follow the systems-centric approach, will we add methods like `get_chassis_indicator(ident)` to libvirt driver? You\u0027ve proposed to use the same ident for all resources being accessed through the system (chassis, manager). But that will become incredibly messy if we\u0027d want to emulate more complex relationships between resources. With Redfish many-to-many is possible:\n\n* one Manager can serve multiple Systems and Chassis\n* multiple Managers can serve the same System or Chassis\n* Chassis can enclose Manager(s), System(s), Drives etc.\n* one Chassis can enclose the other Chassis recursively\n\nIt seems that modeling such a many-to-many relationships with non-unique  UUIDs feels like a sure path to future suffering. On top of that, I am not sure it is a good idea to produce JSONs with duplicate UUIDs for different objects - this is something that should never happen from probabilistic standpoint.\n\nThere is nothing resembling Manager resource realistically atm. If that argument holds, what about the indicators resource? It seems similarly virtual or static, but it is actually useful for testing ironic indicators. You mentioned elsewhere that we should use static simulator for such unrealistic resources. But with indicators we need to have it writable, that can\u0027t be done with static emulator.\n\nI do not see it as a problem having pieces of information configured statically to the emulator. We sort of already do that with templates. BTW,  we do not actually use the static emulator, AFAIK. May be conceptually merging static with dynamic is a way to go?\n\nThis resource separation design I am trying to propose is open-ended -- should we get something to base resource emulation upon, we could just add another driver for that. This works other way round - should we miss some realistic backend for the resource, the resource framework allows replacing the missing resource with a static mock driver.\n\nConsider my RaspberryPi-based Redfish controller we\u0027ve presented at devconf as a use-case. There we plugged systems driver with the one actuating relays (by rude hardcode back then) and would replace indicators resource driver with the one lighting the real physical LEDs on the board.\n\nPardon my long comment!","commit_id":"35028de8f3efd25ff3d54f20bdc2c6378afb1508"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"e62c1e0c5deefe81dd0a6dbdf8e038874482bef1","unresolved":false,"context_lines":[{"line_number":374,"context_line":""},{"line_number":375,"context_line":"        for system in resources.systems.systems:"},{"line_number":376,"context_line":"            try:"},{"line_number":377,"context_line":"                resources.systems.set_boot_image("},{"line_number":378,"context_line":"                    system, device, boot_image\u003dimage_path,"},{"line_number":379,"context_line":"                    write_protected\u003dwrite_protected)"},{"line_number":380,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"dfbec78f_e73f7e84","line":377,"in_reply_to":"dfbec78f_7ed49920","updated":"2019-05-15 07:58:55.000000000","message":"\u003e To reiterate: this is exactly how Redfish puts things together.\n\nRedfish is an API, not an internal architecture design. It\u0027s created to cover all kinds of weird cases, which even real hardware doesn\u0027t have too often. We have two cases: libvirt and openstack, and we\u0027re very unlikely to ever have more.\n\n\u003e  I think they are actually orthogonal and not tightly coupled e.g. you can have X Systems and Y Managers where Y \u003e 0.\n\nRedfish can, we cannot. It\u0027s not going to happen with the backends we have, and virtual media is not going to work this way. It requires 1-1 mapping, and that\u0027s what you have.\n\n\u003e You\u0027ve proposed to use the same ident for all resources being accessed through the system\n\nRight, because they *are* systems from backend perspective. Of course you can generate Manager UUID by XOR-ing System UUID with a constant, I don\u0027t mind. But having a user invent fake resources because of your architectural decisions simply means the decisions are not quite right. This is the key point of my objections, I\u0027m more or less fine with somewhat overcomplicated internal structure.\n\n\u003e On top of that, I am not sure it is a good idea to produce JSONs with duplicate UUIDs for different objects\n\nNo sane consumers should care about that as long as resource types are different (but again, use XOR if it worries you :)\n\n\u003e It seems similarly virtual or static, but it is actually useful for testing ironic indicators.\n\nYou can store an indicator status on a system, if you want to. Anyway, system is the only backend you really have where you can store any state.\n\nAlso I\u0027d question the \"useful\" bit. How is it useful if it does not have a physical representation? What are you testing? It looks like you\u0027ll test that code you wrote for ironic works with code you wrote for sushy-tools. I trust you to write code that is consistent with itself :)\n\n\u003e With Redfish many-to-many is possible.\n\u003e Consider my RaspberryPi-based Redfish controller\n\nLet\u0027s not keep talking about things that have no application to sushy-tools.","commit_id":"35028de8f3efd25ff3d54f20bdc2c6378afb1508"}],"sushy_tools/emulator/resources/managers/staticdriver.py":[{"author":{"_account_id":23851,"name":"Riccardo Pittau","email":"elfosardo@gmail.com","username":"elfosardo"},"change_message_id":"79e9b936a311cb848d517bb03977ca1956761a5e","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":"        raise error.AliasAccessError(uu_identity)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def _get_device(self, identity, device):"},{"line_number":79,"context_line":"        manager \u003d self._get_manager(identity)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":12,"id":"dfbec78f_41803b8c","line":78,"updated":"2019-05-07 12:49:01.000000000","message":"_get_virtual_media_device ?","commit_id":"5c8602e61bdd412a32c15788c34ee7871d925074"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"61b82986ae707932cc389f0784d69c29ec584bbe","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":"        raise error.AliasAccessError(uu_identity)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def _get_device(self, identity, device):"},{"line_number":79,"context_line":"        manager \u003d self._get_manager(identity)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":12,"id":"dfbec78f_8bbba970","line":78,"in_reply_to":"dfbec78f_41803b8c","updated":"2019-05-07 18:08:58.000000000","message":"Oh, that\u0027s totally unused method. Remnants of previous design.","commit_id":"5c8602e61bdd412a32c15788c34ee7871d925074"}],"sushy_tools/emulator/resources/systems/libvirtdriver.py":[{"author":{"_account_id":23851,"name":"Riccardo Pittau","email":"elfosardo@gmail.com","username":"elfosardo"},"change_message_id":"79e9b936a311cb848d517bb03977ca1956761a5e","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        constants.DEVICE_TYPE_PXE: \u0027network\u0027,"},{"line_number":75,"context_line":"        constants.DEVICE_TYPE_HDD: \u0027hd\u0027,"},{"line_number":76,"context_line":"        constants.DEVICE_TYPE_CD: \u0027cdrom\u0027,"},{"line_number":77,"context_line":"    }"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    BOOT_DEVICE_MAP_REV \u003d {v: k for k, v in BOOT_DEVICE_MAP.items()}"},{"line_number":80,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"dfbec78f_e14a8f7e","line":77,"updated":"2019-05-07 12:49:01.000000000","message":"no floppy ?","commit_id":"5c8602e61bdd412a32c15788c34ee7871d925074"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"61b82986ae707932cc389f0784d69c29ec584bbe","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        constants.DEVICE_TYPE_PXE: \u0027network\u0027,"},{"line_number":75,"context_line":"        constants.DEVICE_TYPE_HDD: \u0027hd\u0027,"},{"line_number":76,"context_line":"        constants.DEVICE_TYPE_CD: \u0027cdrom\u0027,"},{"line_number":77,"context_line":"    }"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    BOOT_DEVICE_MAP_REV \u003d {v: k for k, v in BOOT_DEVICE_MAP.items()}"},{"line_number":80,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"dfbec78f_ab630d1a","line":77,"in_reply_to":"dfbec78f_e14a8f7e","updated":"2019-05-07 18:08:58.000000000","message":"Let\u0027s add floppy!","commit_id":"5c8602e61bdd412a32c15788c34ee7871d925074"}],"sushy_tools/tests/unit/emulator/resources/managers/test_static.py":[{"author":{"_account_id":23851,"name":"Riccardo Pittau","email":"elfosardo@gmail.com","username":"elfosardo"},"change_message_id":"79e9b936a311cb848d517bb03977ca1956761a5e","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from sushy_tools.emulator.resources.managers.staticdriver import StaticDriver"},{"line_number":18,"context_line":"from sushy_tools import error"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from oslotest import base"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class StaticDriverTestCase(base.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":12,"id":"dfbec78f_4107db1d","line":20,"updated":"2019-05-07 12:49:01.000000000","message":"this should go back where it was as it\u0027s a third party imported library","commit_id":"5c8602e61bdd412a32c15788c34ee7871d925074"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"61b82986ae707932cc389f0784d69c29ec584bbe","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from sushy_tools.emulator.resources.managers.staticdriver import StaticDriver"},{"line_number":18,"context_line":"from sushy_tools import error"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from oslotest import base"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class StaticDriverTestCase(base.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":12,"id":"dfbec78f_eb80258e","line":20,"in_reply_to":"dfbec78f_4107db1d","updated":"2019-05-07 18:08:58.000000000","message":"/me wonders where is pep8?","commit_id":"5c8602e61bdd412a32c15788c34ee7871d925074"}],"sushy_tools/tests/unit/emulator/resources/vmedia/test_static.py":[{"author":{"_account_id":23851,"name":"Riccardo Pittau","email":"elfosardo@gmail.com","username":"elfosardo"},"change_message_id":"79e9b936a311cb848d517bb03977ca1956761a5e","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":"from sushy_tools.emulator.resources.vmedia.staticdriver import StaticDriver"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from oslotest import base"},{"line_number":18,"context_line":"from six.moves import mock"}],"source_content_type":"text/x-python","patch_set":12,"id":"dfbec78f_5109ec29","line":15,"updated":"2019-05-07 12:49:01.000000000","message":"this should go last as it\u0027s a local import","commit_id":"5c8602e61bdd412a32c15788c34ee7871d925074"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"61b82986ae707932cc389f0784d69c29ec584bbe","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":"from sushy_tools.emulator.resources.vmedia.staticdriver import StaticDriver"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from oslotest import base"},{"line_number":18,"context_line":"from six.moves import mock"}],"source_content_type":"text/x-python","patch_set":12,"id":"dfbec78f_ab4c6d9e","line":15,"in_reply_to":"dfbec78f_5109ec29","updated":"2019-05-07 18:08:58.000000000","message":"Done. Perhaps too many rebases - messed up imports.","commit_id":"5c8602e61bdd412a32c15788c34ee7871d925074"}]}
