)]}'
{"cinder/policy.py":[{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"4dbf4188cd1d84b7beef7805ed25687ea4dfecd7","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"def enforce_action(context, action):"},{"line_number":66,"context_line":"    \"\"\"Checks that the action can be done by the given context."},{"line_number":67,"context_line":"    "},{"line_number":68,"context_line":"    Applies a check to ensure the context\u0027s project_id and user_id can be"},{"line_number":69,"context_line":"    applied to the given action using the policy enforcement api."},{"line_number":70,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":61,"id":"AAAAQn%2F%2FG10%3D","line":67,"updated":"2013-08-07 04:18:01.000000000","message":"oops","commit_id":"8c4b56b2e6253a2653a746f1884f716797b43e82"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"39cdd1c4b0ceb15c354f84d48f3915d8bddaa301","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"def enforce_action(context, action):"},{"line_number":66,"context_line":"    \"\"\"Checks that the action can be done by the given context."},{"line_number":67,"context_line":"    "},{"line_number":68,"context_line":"    Applies a check to ensure the context\u0027s project_id and user_id can be"},{"line_number":69,"context_line":"    applied to the given action using the policy enforcement api."},{"line_number":70,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":61,"id":"AAAAQn%2F%2FGxM%3D","line":67,"in_reply_to":"AAAAQn%2F%2FG10%3D","updated":"2013-08-07 05:02:55.000000000","message":"oops","commit_id":"8c4b56b2e6253a2653a746f1884f716797b43e82"}],"cinder/scheduler/manager.py":[{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"4dbf4188cd1d84b7beef7805ed25687ea4dfecd7","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        try:"},{"line_number":95,"context_line":"            flow.run(context)"},{"line_number":96,"context_line":"        except exception.NoValidHost:"},{"line_number":97,"context_line":"            pass"},{"line_number":98,"context_line":"        if flow.state !\u003d states.SUCCESS:"},{"line_number":99,"context_line":"            LOG.warn(_(\"Failed to successfully complete\""}],"source_content_type":"text/x-python","patch_set":61,"id":"AAAAQn%2F%2FG1I%3D","line":96,"updated":"2013-08-07 04:18:01.000000000","message":"Not sure where we\u0027re doing _set_state_and_notify in this case?","commit_id":"8c4b56b2e6253a2653a746f1884f716797b43e82"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"39cdd1c4b0ceb15c354f84d48f3915d8bddaa301","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        try:"},{"line_number":95,"context_line":"            flow.run(context)"},{"line_number":96,"context_line":"        except exception.NoValidHost:"},{"line_number":97,"context_line":"            pass"},{"line_number":98,"context_line":"        if flow.state !\u003d states.SUCCESS:"},{"line_number":99,"context_line":"            LOG.warn(_(\"Failed to successfully complete\""}],"source_content_type":"text/x-python","patch_set":61,"id":"AAAAQn%2F%2FGwo%3D","line":96,"in_reply_to":"AAAAQn%2F%2FG1I%3D","updated":"2013-08-07 05:02:55.000000000","message":"U were.\n\nNow its being handled by the following task.\n\n  scheduler_flow.add(NotifySchedulerFailureTask(\u0027create_volume\u0027))\n\nThis tasks job is to just to be called when reverting occurs. \n\nSee: get_scheduler_flow()","commit_id":"8c4b56b2e6253a2653a746f1884f716797b43e82"}],"cinder/volume/api.py":[{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"7e12a9b9de6f554dcb4a43f9f6eea609edae8636","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                                self.volume_rpcapi, self.db,"},{"line_number":108,"context_line":"                                **api_kwargs)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        flow.run(job.context)"},{"line_number":111,"context_line":"        # TODO: check that it worked out??"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        volume \u003d None"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2F2R8%3D","line":110,"updated":"2013-05-21 19:51:53.000000000","message":"Make sure flow isn\u0027t None here?","commit_id":"96897432cc6202bf7e420bd8a64655d5bdee5639"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"e1c01ef7f4dc931ac58a9a08b245f2ffa7aefded","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                                self.volume_rpcapi, self.db,"},{"line_number":108,"context_line":"                                **api_kwargs)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        flow.run(job.context)"},{"line_number":111,"context_line":"        # TODO: check that it worked out??"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        volume \u003d None"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2F2Eo%3D","line":110,"in_reply_to":"AAAAPH%2F%2F2R8%3D","updated":"2013-05-21 20:47:19.000000000","message":"Sure.","commit_id":"96897432cc6202bf7e420bd8a64655d5bdee5639"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"7e12a9b9de6f554dcb4a43f9f6eea609edae8636","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        # TODO: check that it worked out??"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        volume \u003d None"},{"line_number":114,"context_line":"        for (t, t_results) in flow.results:"},{"line_number":115,"context_line":"            if \u0027volume\u0027 in t.provides():"},{"line_number":116,"context_line":"                volume \u003d t_results[\u0027volume\u0027]"},{"line_number":117,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2F2R4%3D","line":114,"updated":"2013-05-21 19:51:53.000000000","message":"t ?","commit_id":"96897432cc6202bf7e420bd8a64655d5bdee5639"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"e1c01ef7f4dc931ac58a9a08b245f2ffa7aefded","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        # TODO: check that it worked out??"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        volume \u003d None"},{"line_number":114,"context_line":"        for (t, t_results) in flow.results:"},{"line_number":115,"context_line":"            if \u0027volume\u0027 in t.provides():"},{"line_number":116,"context_line":"                volume \u003d t_results[\u0027volume\u0027]"},{"line_number":117,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2F2Eg%3D","line":114,"in_reply_to":"AAAAPH%2F%2F2R4%3D","updated":"2013-05-21 20:47:19.000000000","message":"Agreed, will expand :-)","commit_id":"96897432cc6202bf7e420bd8a64655d5bdee5639"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"52df72574d3d77e3038b126c0e1e8c8e394cd05d","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"import functools"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from taskflow import states"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from oslo.config import cfg"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPH%2F%2F1ZQ%3D","line":25,"updated":"2013-05-22 01:25:22.000000000","message":"from taskflow import job\nfrom taskflow import task","commit_id":"92a0fea35a1ed71333edfa401f05b0c12621afce"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"e4a9ab6185fbe3f825381a507f53b211fcf5be9d","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"import functools"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from taskflow import states"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from oslo.config import cfg"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPH%2F%2F05s%3D","line":25,"in_reply_to":"AAAAPH%2F%2F1ZQ%3D","updated":"2013-05-22 06:21:44.000000000","message":"Confused here, can u explain what you mean. Thx :-)","commit_id":"92a0fea35a1ed71333edfa401f05b0c12621afce"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"dc3a28c96e5e452bb8cf11ed018a92b729c3b850","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        # NOTE(haomai): In case of volume services isn\u0027t init or"},{"line_number":95,"context_line":"        # availability_zones is updated in the backend we will lazily"},{"line_number":96,"context_line":"        # load this now instead."},{"line_number":97,"context_line":"        if self._availability_zones is not None:"},{"line_number":98,"context_line":"            return set(self._availability_zones)"},{"line_number":99,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":100,"context_line":"        topic \u003d CONF.volume_topic"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAAPn%2F%2F07w%3D","line":97,"updated":"2013-06-20 10:28:57.000000000","message":"Does this mean we need to restart the API server if we add an availability zone? I think that is a new constraint, and will need documenting at least, though I\u0027d prefer to come up with a way of removing it... maybe pass a validation callback in rather than a set, so that if the AZ isn\u0027t in the cached set then we can reload and check again. This is how the old _check_availability_zone behaved.","commit_id":"5491037bc13ebc9cc02d1703332c02f2b87facc0"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"e86f1daa955aa13cd67f195e1c7e5b526ee2c6f5","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        # NOTE(haomai): In case of volume services isn\u0027t init or"},{"line_number":95,"context_line":"        # availability_zones is updated in the backend we will lazily"},{"line_number":96,"context_line":"        # load this now instead."},{"line_number":97,"context_line":"        if self._availability_zones is not None:"},{"line_number":98,"context_line":"            return set(self._availability_zones)"},{"line_number":99,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":100,"context_line":"        topic \u003d CONF.volume_topic"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAAPn%2F%2Fz1k%3D","line":97,"in_reply_to":"AAAAPn%2F%2F07w%3D","updated":"2013-06-20 17:37:45.000000000","message":"Thanks, good catch! Will fix that. Logic failure on my part.","commit_id":"5491037bc13ebc9cc02d1703332c02f2b87facc0"}],"cinder/volume/flows/create_volume.py":[{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"7e12a9b9de6f554dcb4a43f9f6eea609edae8636","unresolved":false,"context_lines":[{"line_number":388,"context_line":""},{"line_number":389,"context_line":""},{"line_number":390,"context_line":"def get_api_flow(the_job, scheduler_rpcapi, volume_rpcapi, db, **kwargs):"},{"line_number":391,"context_line":"    wf \u003d gf.Flow(\"%s-api\" % (the_job.name))"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"    # Api tasks"},{"line_number":394,"context_line":"    wf.add(KwargsInjectTask(**kwargs))"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2F2Pg%3D","line":391,"updated":"2013-05-21 19:51:53.000000000","message":"Can you expand on your variable names a bit.   I don\u0027t know what gf means here... I know it\u0027s from the import, but it\u0027s a bit hard to read.\n\nSame with wf","commit_id":"96897432cc6202bf7e420bd8a64655d5bdee5639"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"24c0dbf299e717aa16a6ae554c6ed748b660345f","unresolved":false,"context_lines":[{"line_number":388,"context_line":""},{"line_number":389,"context_line":""},{"line_number":390,"context_line":"def get_api_flow(the_job, scheduler_rpcapi, volume_rpcapi, db, **kwargs):"},{"line_number":391,"context_line":"    wf \u003d gf.Flow(\"%s-api\" % (the_job.name))"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"    # Api tasks"},{"line_number":394,"context_line":"    wf.add(KwargsInjectTask(**kwargs))"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2F1ik%3D","line":391,"in_reply_to":"AAAAPH%2F%2F2Pg%3D","updated":"2013-05-22 00:23:12.000000000","message":"Yup :)","commit_id":"96897432cc6202bf7e420bd8a64655d5bdee5639"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"631a9dac5e108758a650e6925cf4bd9d061d6777","unresolved":false,"context_lines":[{"line_number":400,"context_line":""},{"line_number":401,"context_line":"    # This joins all the tasks inputs/outputs in the correct manner"},{"line_number":402,"context_line":"    # so that said tasks can be ran in the correct order."},{"line_number":403,"context_line":"    wf.connect()"},{"line_number":404,"context_line":""},{"line_number":405,"context_line":"    # This associates the workflow with the job so that resumption"},{"line_number":406,"context_line":"    # can occur."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2F1dA%3D","line":403,"updated":"2013-05-22 00:49:14.000000000","message":"Can this be done automatically when you tell the job to run?","commit_id":"96897432cc6202bf7e420bd8a64655d5bdee5639"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"50dd383d55b3923621ad1fc3788b04f66adec773","unresolved":false,"context_lines":[{"line_number":400,"context_line":""},{"line_number":401,"context_line":"    # This joins all the tasks inputs/outputs in the correct manner"},{"line_number":402,"context_line":"    # so that said tasks can be ran in the correct order."},{"line_number":403,"context_line":"    wf.connect()"},{"line_number":404,"context_line":""},{"line_number":405,"context_line":"    # This associates the workflow with the job so that resumption"},{"line_number":406,"context_line":"    # can occur."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2F1ck%3D","line":403,"in_reply_to":"AAAAPH%2F%2F1dA%3D","updated":"2013-05-22 00:56:04.000000000","message":"It is, I guess I can leave that off :-)","commit_id":"96897432cc6202bf7e420bd8a64655d5bdee5639"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"631a9dac5e108758a650e6925cf4bd9d061d6777","unresolved":false,"context_lines":[{"line_number":404,"context_line":""},{"line_number":405,"context_line":"    # This associates the workflow with the job so that resumption"},{"line_number":406,"context_line":"    # can occur."},{"line_number":407,"context_line":"    the_job.associate(wf)"},{"line_number":408,"context_line":"    return wf"},{"line_number":409,"context_line":""},{"line_number":410,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2F1c4%3D","line":407,"updated":"2013-05-22 00:49:14.000000000","message":"Can\u0027t this be done automatically by the call in api.py\nflow.run(job.context) ?","commit_id":"96897432cc6202bf7e420bd8a64655d5bdee5639"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"50dd383d55b3923621ad1fc3788b04f66adec773","unresolved":false,"context_lines":[{"line_number":404,"context_line":""},{"line_number":405,"context_line":"    # This associates the workflow with the job so that resumption"},{"line_number":406,"context_line":"    # can occur."},{"line_number":407,"context_line":"    the_job.associate(wf)"},{"line_number":408,"context_line":"    return wf"},{"line_number":409,"context_line":""},{"line_number":410,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2F1cg%3D","line":407,"in_reply_to":"AAAAPH%2F%2F1c4%3D","updated":"2013-05-22 00:56:04.000000000","message":"A workflow doesn\u0027t currently know about the job its connected to. So currently this would be done. A workflow can run without a job, the job just provides the tracking and resumption information for the workflow to use. The associate method connects up the correct listeners and result fetching code into the workflow. This could be adjusted if desired.","commit_id":"96897432cc6202bf7e420bd8a64655d5bdee5639"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"af124527b2a75d214b00a017297e5e7d53a1d2ea","unresolved":false,"context_lines":[{"line_number":404,"context_line":""},{"line_number":405,"context_line":"    # This associates the workflow with the job so that resumption"},{"line_number":406,"context_line":"    # can occur."},{"line_number":407,"context_line":"    the_job.associate(wf)"},{"line_number":408,"context_line":"    return wf"},{"line_number":409,"context_line":""},{"line_number":410,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2F1cc%3D","line":407,"in_reply_to":"AAAAPH%2F%2F1c4%3D","updated":"2013-05-22 00:55:46.000000000","message":"Looks like we don\u0027t really even need the_job in here if we can just change the api of flow.run to \nflow.run(job)\nand then inside of run, the first thing it does is job.associate(self)\nand then uses the context out of job.context.\n\nThe simpler the API and the requirements to run the job the better.","commit_id":"96897432cc6202bf7e420bd8a64655d5bdee5639"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"0d3cc063a75e3dc08837ce4e7ab6553b88d5b676","unresolved":false,"context_lines":[{"line_number":404,"context_line":""},{"line_number":405,"context_line":"    # This associates the workflow with the job so that resumption"},{"line_number":406,"context_line":"    # can occur."},{"line_number":407,"context_line":"    the_job.associate(wf)"},{"line_number":408,"context_line":"    return wf"},{"line_number":409,"context_line":""},{"line_number":410,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2F1b4%3D","line":407,"in_reply_to":"AAAAPH%2F%2F1cI%3D","updated":"2013-05-22 01:00:07.000000000","message":"Job.run(wf) sounds like a good idea! Will do.","commit_id":"96897432cc6202bf7e420bd8a64655d5bdee5639"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"d0a9666a68dd7a227fc4996cbdbca6d4e1b79eb8","unresolved":false,"context_lines":[{"line_number":404,"context_line":""},{"line_number":405,"context_line":"    # This associates the workflow with the job so that resumption"},{"line_number":406,"context_line":"    # can occur."},{"line_number":407,"context_line":"    the_job.associate(wf)"},{"line_number":408,"context_line":"    return wf"},{"line_number":409,"context_line":""},{"line_number":410,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2F1cI%3D","line":407,"in_reply_to":"AAAAPH%2F%2F1cg%3D","updated":"2013-05-22 00:57:54.000000000","message":"I\u0027m just trying to simplify the API a bit here so that when others write their own get_api_flow() for say...snapshots, it\u0027s just a matter of making a bunch of wf.add() calls and returning the wf.  \n\njob.run() does the rest ?","commit_id":"96897432cc6202bf7e420bd8a64655d5bdee5639"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"8e0599bdfdd0c24132bc5969e5f48e14a98a16c5","unresolved":false,"context_lines":[{"line_number":64,"context_line":"    return None"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"def as_int(obj):"},{"line_number":68,"context_line":"    # Try \"2\" -\u003e 2"},{"line_number":69,"context_line":"    try:"},{"line_number":70,"context_line":"        return int(obj)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2Fq2E%3D","line":67,"updated":"2013-06-13 04:54:26.000000000","message":"might be good to have this in utils for other use","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"5f2643a21e12e82385aec8225d9ab042405dee2f","unresolved":false,"context_lines":[{"line_number":64,"context_line":"    return None"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"def as_int(obj):"},{"line_number":68,"context_line":"    # Try \"2\" -\u003e 2"},{"line_number":69,"context_line":"    try:"},{"line_number":70,"context_line":"        return int(obj)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2Fqxg%3D","line":67,"in_reply_to":"AAAAPX%2F%2Fq2E%3D","updated":"2013-06-13 05:35:23.000000000","message":"agreed.","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"8e0599bdfdd0c24132bc5969e5f48e14a98a16c5","unresolved":false,"context_lines":[{"line_number":91,"context_line":"    \"\"\"Checks that the volume:create action can be done by the given"},{"line_number":92,"context_line":"    context using the policy enforcement api.\"\"\""},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    # TODO(harlowja): move policy checking to a single utils file?"},{"line_number":95,"context_line":"    target \u003d {"},{"line_number":96,"context_line":"        \u0027project_id\u0027: context.project_id,"},{"line_number":97,"context_line":"        \u0027user_id\u0027: context.user_id,"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2Fq18%3D","line":94,"updated":"2013-06-13 04:54:26.000000000","message":"Yes please :)","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"5f2643a21e12e82385aec8225d9ab042405dee2f","unresolved":false,"context_lines":[{"line_number":91,"context_line":"    \"\"\"Checks that the volume:create action can be done by the given"},{"line_number":92,"context_line":"    context using the policy enforcement api.\"\"\""},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    # TODO(harlowja): move policy checking to a single utils file?"},{"line_number":95,"context_line":"    target \u003d {"},{"line_number":96,"context_line":"        \u0027project_id\u0027: context.project_id,"},{"line_number":97,"context_line":"        \u0027user_id\u0027: context.user_id,"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2Fqxc%3D","line":94,"in_reply_to":"AAAAPX%2F%2Fq18%3D","updated":"2013-06-13 05:35:23.000000000","message":"sounds good :-P","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"8e0599bdfdd0c24132bc5969e5f48e14a98a16c5","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"def get_volume_field(context, db, volume_id, field):"},{"line_number":119,"context_line":"    # Fetch the volume reference and get the field from that."},{"line_number":120,"context_line":"    volume_ref \u003d db.volume_get(context, volume_id)"},{"line_number":121,"context_line":"    return volume_ref[field]"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2Fq1s%3D","line":118,"updated":"2013-06-13 04:54:26.000000000","message":"So I like this for the most part, and although I don\u0027t see the situation arising here it seems like a general \"get ref\" would be better, then we don\u0027t have multiple queries to the db to get multiple fields that might be needed from the same object... know what I mean?","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"5f2643a21e12e82385aec8225d9ab042405dee2f","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"def get_volume_field(context, db, volume_id, field):"},{"line_number":119,"context_line":"    # Fetch the volume reference and get the field from that."},{"line_number":120,"context_line":"    volume_ref \u003d db.volume_get(context, volume_id)"},{"line_number":121,"context_line":"    return volume_ref[field]"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2FqxQ%3D","line":118,"in_reply_to":"AAAAPX%2F%2Fq1s%3D","updated":"2013-06-13 05:35:23.000000000","message":"Unsure what u mean :) I was going to add caching of this information, but skipped that.","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"8e0599bdfdd0c24132bc5969e5f48e14a98a16c5","unresolved":false,"context_lines":[{"line_number":121,"context_line":"    return volume_ref[field]"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"def get_volume_name(context, db, volume_id, volume_spec\u003dNone):"},{"line_number":125,"context_line":"    vol_name \u003d None"},{"line_number":126,"context_line":"    if volume_spec:"},{"line_number":127,"context_line":"        # If we have a volume spec use the name that should already exist in"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2Fq1o%3D","line":124,"updated":"2013-06-13 04:54:26.000000000","message":"same vein as above, but also volume[\u0027name\u0027] isn\u0027t required in Cinder, we should ref everything on UUID.","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"5f2643a21e12e82385aec8225d9ab042405dee2f","unresolved":false,"context_lines":[{"line_number":121,"context_line":"    return volume_ref[field]"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"def get_volume_name(context, db, volume_id, volume_spec\u003dNone):"},{"line_number":125,"context_line":"    vol_name \u003d None"},{"line_number":126,"context_line":"    if volume_spec:"},{"line_number":127,"context_line":"        # If we have a volume spec use the name that should already exist in"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2FqxE%3D","line":124,"in_reply_to":"AAAAPX%2F%2Fq1o%3D","updated":"2013-06-13 05:35:23.000000000","message":"Ok, its used in a few places for log messages really, I can switch them all over to uuid/id","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"8e0599bdfdd0c24132bc5969e5f48e14a98a16c5","unresolved":false,"context_lines":[{"line_number":139,"context_line":"def restore_source_status(context, db, volume_spec):"},{"line_number":140,"context_line":"    if not volume_spec:"},{"line_number":141,"context_line":"        return"},{"line_number":142,"context_line":"    if volume_spec.get(\u0027type\u0027) !\u003d \u0027source_vol\u0027:"},{"line_number":143,"context_line":"        return"},{"line_number":144,"context_line":"    source_volid \u003d volume_spec[\u0027source_volid\u0027]"},{"line_number":145,"context_line":"    source_status \u003d volume_spec[\u0027source_volstatus\u0027]"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2Fq0c%3D","line":142,"updated":"2013-06-13 04:54:26.000000000","message":"What\u0027s the idea here?","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"5f2643a21e12e82385aec8225d9ab042405dee2f","unresolved":false,"context_lines":[{"line_number":139,"context_line":"def restore_source_status(context, db, volume_spec):"},{"line_number":140,"context_line":"    if not volume_spec:"},{"line_number":141,"context_line":"        return"},{"line_number":142,"context_line":"    if volume_spec.get(\u0027type\u0027) !\u003d \u0027source_vol\u0027:"},{"line_number":143,"context_line":"        return"},{"line_number":144,"context_line":"    source_volid \u003d volume_spec[\u0027source_volid\u0027]"},{"line_number":145,"context_line":"    source_status \u003d volume_spec[\u0027source_volstatus\u0027]"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2Fqw8%3D","line":142,"in_reply_to":"AAAAPX%2F%2Fq0c%3D","updated":"2013-06-13 05:35:23.000000000","message":"So this is related to the creation of volume ExtractVolumeSpecTask below, instead of having a complex set of if statements there, we can run the request through a initial parse that determines what type the volume specification is. And this restoring of source volume status is only useful if the type of the volume to be created is \u0027source volume\u0027, for the other types (snap, image, regular volume) this restoring shouldn\u0027t be triggered.","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"b4262311f7f58d1794ed7807a4bfafb732decd52","unresolved":false,"context_lines":[{"line_number":139,"context_line":"def restore_source_status(context, db, volume_spec):"},{"line_number":140,"context_line":"    if not volume_spec:"},{"line_number":141,"context_line":"        return"},{"line_number":142,"context_line":"    if volume_spec.get(\u0027type\u0027) !\u003d \u0027source_vol\u0027:"},{"line_number":143,"context_line":"        return"},{"line_number":144,"context_line":"    source_volid \u003d volume_spec[\u0027source_volid\u0027]"},{"line_number":145,"context_line":"    source_status \u003d volume_spec[\u0027source_volstatus\u0027]"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2Fquo%3D","line":142,"in_reply_to":"AAAAPX%2F%2Fqw8%3D","updated":"2013-06-13 05:41:08.000000000","message":"This was part of the logic of the volume manager creation process, when it would error previously the following would be triggered, https://github.com/openstack/cinder/blob/master/cinder/volume/manager.py#L263, this is that logic done slightly differently. As for why that restoring is done, i\u0027m not quite sure really, but i didn\u0027t want to break to much ;)","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"8e0599bdfdd0c24132bc5969e5f48e14a98a16c5","unresolved":false,"context_lines":[{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        source_volid \u003d None"},{"line_number":236,"context_line":"        if source_volume is not None:"},{"line_number":237,"context_line":"            if source_volume[\u0027status\u0027] in (\"error\",):"},{"line_number":238,"context_line":"                msg \u003d _(\"Unable to clone volumes that are in an error state\")"},{"line_number":239,"context_line":"                raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":240,"context_line":"            source_volid \u003d source_volume[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2Fq1Q%3D","line":237,"updated":"2013-06-13 04:54:26.000000000","message":"might be safer to use \u0027status\u0027 \u003d\u003d \u0027available\u0027 to start","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"5f2643a21e12e82385aec8225d9ab042405dee2f","unresolved":false,"context_lines":[{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        source_volid \u003d None"},{"line_number":236,"context_line":"        if source_volume is not None:"},{"line_number":237,"context_line":"            if source_volume[\u0027status\u0027] in (\"error\",):"},{"line_number":238,"context_line":"                msg \u003d _(\"Unable to clone volumes that are in an error state\")"},{"line_number":239,"context_line":"                raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":240,"context_line":"            source_volid \u003d source_volume[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2Fqw4%3D","line":237,"in_reply_to":"AAAAPX%2F%2Fq1Q%3D","updated":"2013-06-13 05:35:23.000000000","message":"sure.","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"8e0599bdfdd0c24132bc5969e5f48e14a98a16c5","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        return source_volid"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"    @staticmethod"},{"line_number":244,"context_line":"    def _extract_size(size, source_volume):"},{"line_number":245,"context_line":"        \"\"\"Extracts the size from the provide size variable or from the source"},{"line_number":246,"context_line":"        volume if the size is not provided (and a source volume is provided)"},{"line_number":247,"context_line":"        and then does basic validation on the size that is found.\"\"\""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2Fq00%3D","line":244,"updated":"2013-06-13 04:54:26.000000000","message":"not quite sure I get what the intent is here.","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"5f2643a21e12e82385aec8225d9ab042405dee2f","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        return source_volid"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"    @staticmethod"},{"line_number":244,"context_line":"    def _extract_size(size, source_volume):"},{"line_number":245,"context_line":"        \"\"\"Extracts the size from the provide size variable or from the source"},{"line_number":246,"context_line":"        volume if the size is not provided (and a source volume is provided)"},{"line_number":247,"context_line":"        and then does basic validation on the size that is found.\"\"\""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2Fqw0%3D","line":244,"in_reply_to":"AAAAPX%2F%2Fq00%3D","updated":"2013-06-13 05:35:23.000000000","message":"splitting up of the extract and validation logic of the input api request, instead of having it be 1 big if statement, split the validation/extract into functional pieces each handling a specific piece. Makes the __call__ pretty small and easy to read. So this is the logic that determined the \u0027real\u0027 size of the volume to be created, which can be affected by the source_volume if the size is none/zero.","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"8e0599bdfdd0c24132bc5969e5f48e14a98a16c5","unresolved":false,"context_lines":[{"line_number":249,"context_line":"        if not size and source_volume:"},{"line_number":250,"context_line":"            size \u003d source_volume[\u0027size\u0027]"},{"line_number":251,"context_line":"        size \u003d as_int(size)"},{"line_number":252,"context_line":"        if not isinstance(size, int) or size \u003c\u003d 0:"},{"line_number":253,"context_line":"            msg \u003d (_(\"Volume size \u0027%s\u0027 must be an integer and greater than 0\")"},{"line_number":254,"context_line":"                   % size)"},{"line_number":255,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2Fq08%3D","line":252,"updated":"2013-06-13 04:54:26.000000000","message":"Not sure how we\u0027d hit this... if we\u0027ve gotten to a point where there\u0027s invalid data in the DB ref we\u0027ve got bigger issues.","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"5f2643a21e12e82385aec8225d9ab042405dee2f","unresolved":false,"context_lines":[{"line_number":249,"context_line":"        if not size and source_volume:"},{"line_number":250,"context_line":"            size \u003d source_volume[\u0027size\u0027]"},{"line_number":251,"context_line":"        size \u003d as_int(size)"},{"line_number":252,"context_line":"        if not isinstance(size, int) or size \u003c\u003d 0:"},{"line_number":253,"context_line":"            msg \u003d (_(\"Volume size \u0027%s\u0027 must be an integer and greater than 0\")"},{"line_number":254,"context_line":"                   % size)"},{"line_number":255,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2FqwM%3D","line":252,"in_reply_to":"AAAAPX%2F%2Fq08%3D","updated":"2013-06-13 05:35:23.000000000","message":"So this task actually does the extraction and validation of the api request, before the DB entry is created so thats why this is here since we are still in \u0027user input land\u0027","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"8e0599bdfdd0c24132bc5969e5f48e14a98a16c5","unresolved":false,"context_lines":[{"line_number":316,"context_line":""},{"line_number":317,"context_line":"        snapshot_id \u003d self._extract_snapshot(snapshot)"},{"line_number":318,"context_line":"        source_volid \u003d self._extract_source_volume(source_volume)"},{"line_number":319,"context_line":"        size \u003d self._extract_size(size, source_volume)"},{"line_number":320,"context_line":""},{"line_number":321,"context_line":"        self._check_image_metadata(context, image_id, size)"},{"line_number":322,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2Fq0o%3D","line":319,"updated":"2013-06-13 04:54:26.000000000","message":"Made a comment in the _extract_size method def, but I\u0027m curious what the intent here is?  To get the size why aren\u0027t we just using source_volume[\u0027size\u0027] and moving on?","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"4e3b71c1cd20fae677ebcd9561f20bcc6e795dcb","unresolved":false,"context_lines":[{"line_number":316,"context_line":""},{"line_number":317,"context_line":"        snapshot_id \u003d self._extract_snapshot(snapshot)"},{"line_number":318,"context_line":"        source_volid \u003d self._extract_source_volume(source_volume)"},{"line_number":319,"context_line":"        size \u003d self._extract_size(size, source_volume)"},{"line_number":320,"context_line":""},{"line_number":321,"context_line":"        self._check_image_metadata(context, image_id, size)"},{"line_number":322,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2FqvM%3D","line":319,"in_reply_to":"AAAAPX%2F%2Fq0o%3D","updated":"2013-06-13 05:38:07.000000000","message":"the size can only be extracted from the source_volume if the user provided a source volume to extract it from, at this point when we are in the api we don\u0027t quite know that yet. The extract_size method determines that information + does validation that the size isn\u0027t crazy.","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"8e0599bdfdd0c24132bc5969e5f48e14a98a16c5","unresolved":false,"context_lines":[{"line_number":570,"context_line":"        error_out_volume(context, self.db, volume_id, reason\u003dcause.exc)"},{"line_number":571,"context_line":"        volume_ident \u003d volume_id"},{"line_number":572,"context_line":"        try:"},{"line_number":573,"context_line":"            volume_ident \u003d get_volume_name(context, self.db, volume_id,"},{"line_number":574,"context_line":"                                           volume_spec)"},{"line_number":575,"context_line":"        except exception.CinderException:"},{"line_number":576,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2Fq2M%3D","line":573,"updated":"2013-06-13 04:54:26.000000000","message":"why are we setting volume_ident off of volume_id above, then setting again here off of a querie to get the name?\n\nI\u0027d rather just see id used everywhere anyway... name is optional  for volumes in Cinder.  Also not sure what we\u0027d catch here...","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"5f2643a21e12e82385aec8225d9ab042405dee2f","unresolved":false,"context_lines":[{"line_number":570,"context_line":"        error_out_volume(context, self.db, volume_id, reason\u003dcause.exc)"},{"line_number":571,"context_line":"        volume_ident \u003d volume_id"},{"line_number":572,"context_line":"        try:"},{"line_number":573,"context_line":"            volume_ident \u003d get_volume_name(context, self.db, volume_id,"},{"line_number":574,"context_line":"                                           volume_spec)"},{"line_number":575,"context_line":"        except exception.CinderException:"},{"line_number":576,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPX%2F%2Fqv4%3D","line":573,"in_reply_to":"AAAAPX%2F%2Fq2M%3D","updated":"2013-06-13 05:35:23.000000000","message":"wfm, the catch was if the database read somehow failed, possibly due to the volume being read going away, or the database failing.","commit_id":"735fc61b592665067bc3e686575a15916fa8266f"},{"author":{"_account_id":1773,"name":"oliver-leahy-l","email":"oliver.leahy@hpe.com","username":"oliver-leahy-l"},"change_message_id":"36d5013efdff343903188c0bffa26bb2ce63afee","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    policy.enforce(context, ACTION, target)"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"def check_exclusive_options(**kwargs):"},{"line_number":103,"context_line":"    \"\"\"Checks that only one of the provided options is actually not-None"},{"line_number":104,"context_line":"    and if more than one are not-None then this raises an exception.\"\"\""},{"line_number":105,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2FpjI%3D","line":102,"updated":"2013-06-13 16:16:47.000000000","message":"Seems like a lot of these functions could be useful for all the task classes (create_snapshot, create/delete_volume etc). So they could go to a utils file with check_policy()","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"c73d60eef1aef629dacdeebe9ef0c88cbb89defa","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    policy.enforce(context, ACTION, target)"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"def check_exclusive_options(**kwargs):"},{"line_number":103,"context_line":"    \"\"\"Checks that only one of the provided options is actually not-None"},{"line_number":104,"context_line":"    and if more than one are not-None then this raises an exception.\"\"\""},{"line_number":105,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2Fo54%3D","line":102,"in_reply_to":"AAAAPX%2F%2FpjI%3D","updated":"2013-06-13 18:20:02.000000000","message":"100% agreed. If we wait to move though, that might be ok, since its hard to tell what will go where in the future at this point :)","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1773,"name":"oliver-leahy-l","email":"oliver.leahy@hpe.com","username":"oliver-leahy-l"},"change_message_id":"36d5013efdff343903188c0bffa26bb2ce63afee","unresolved":false,"context_lines":[{"line_number":226,"context_line":"                # TODO(harlowja): what happens if the status changes after this"},{"line_number":227,"context_line":"                # initial snapshot status check occurs??? Seems like someone"},{"line_number":228,"context_line":"                # could delete the snapshot after this check passes but before"},{"line_number":229,"context_line":"                # the volume is offically created?"},{"line_number":230,"context_line":"                raise exception.InvalidSnapshot(reason\u003dmsg)"},{"line_number":231,"context_line":"            snapshot_id \u003d snapshot[\u0027id\u0027]"},{"line_number":232,"context_line":"        return snapshot_id"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2Fpo0%3D","line":229,"updated":"2013-06-13 16:16:47.000000000","message":"That sounds like we need a \u0027creating_snapshot\u0027 status for volumes. This method could set the status of the source volume to \u0027creating_snapshot\u0027, and the delete state machine would then be able to refuse to delete the volume until the snapshot process completed...\n\nWe\u0027d have to write a db function that checked that the state of the source volume was available (or possibly either available or in-use) and then set it to creating_snapshot (or creating-snapshot-in-use) within a db session.","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"7466e176a9ef22314a3c49c7649411d210771057","unresolved":false,"context_lines":[{"line_number":226,"context_line":"                # TODO(harlowja): what happens if the status changes after this"},{"line_number":227,"context_line":"                # initial snapshot status check occurs??? Seems like someone"},{"line_number":228,"context_line":"                # could delete the snapshot after this check passes but before"},{"line_number":229,"context_line":"                # the volume is offically created?"},{"line_number":230,"context_line":"                raise exception.InvalidSnapshot(reason\u003dmsg)"},{"line_number":231,"context_line":"            snapshot_id \u003d snapshot[\u0027id\u0027]"},{"line_number":232,"context_line":"        return snapshot_id"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2FmSI%3D","line":229,"in_reply_to":"AAAAPX%2F%2Fm48%3D","updated":"2013-06-14 17:05:04.000000000","message":"Sure, i just worry about the usage of status names as locks when they really aren\u0027t :-P I agree they are useful, but i think we shouldn\u0027t mix there usage with the usage of a lock on a resource.","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1773,"name":"oliver-leahy-l","email":"oliver.leahy@hpe.com","username":"oliver-leahy-l"},"change_message_id":"c5bc26ecb51de63ffa656899b848b3a86a2d3c52","unresolved":false,"context_lines":[{"line_number":226,"context_line":"                # TODO(harlowja): what happens if the status changes after this"},{"line_number":227,"context_line":"                # initial snapshot status check occurs??? Seems like someone"},{"line_number":228,"context_line":"                # could delete the snapshot after this check passes but before"},{"line_number":229,"context_line":"                # the volume is offically created?"},{"line_number":230,"context_line":"                raise exception.InvalidSnapshot(reason\u003dmsg)"},{"line_number":231,"context_line":"            snapshot_id \u003d snapshot[\u0027id\u0027]"},{"line_number":232,"context_line":"        return snapshot_id"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2Fm48%3D","line":229,"in_reply_to":"AAAAPX%2F%2Fo5s%3D","updated":"2013-06-14 15:01:15.000000000","message":"ok, sounds good. I guess I\u0027m not totally in the picture here, but status names are cheap, and when things go wrong they can often make it easier to debug the situation.","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"c73d60eef1aef629dacdeebe9ef0c88cbb89defa","unresolved":false,"context_lines":[{"line_number":226,"context_line":"                # TODO(harlowja): what happens if the status changes after this"},{"line_number":227,"context_line":"                # initial snapshot status check occurs??? Seems like someone"},{"line_number":228,"context_line":"                # could delete the snapshot after this check passes but before"},{"line_number":229,"context_line":"                # the volume is offically created?"},{"line_number":230,"context_line":"                raise exception.InvalidSnapshot(reason\u003dmsg)"},{"line_number":231,"context_line":"            snapshot_id \u003d snapshot[\u0027id\u0027]"},{"line_number":232,"context_line":"        return snapshot_id"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2Fo5s%3D","line":229,"in_reply_to":"AAAAPX%2F%2Fpo0%3D","updated":"2013-06-13 18:20:02.000000000","message":"Its something like that, although u are entering an area that i think is better solved with some type of locking on resources and using said lock to disallow operations. \n\nI\u0027ve thought about this @ https://wiki.openstack.org/wiki/StructuredWorkflowLocks","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1773,"name":"oliver-leahy-l","email":"oliver.leahy@hpe.com","username":"oliver-leahy-l"},"change_message_id":"36d5013efdff343903188c0bffa26bb2ce63afee","unresolved":false,"context_lines":[{"line_number":244,"context_line":"                # TODO(harlowja): what happens if the status changes after this"},{"line_number":245,"context_line":"                # initial volume status check occurs??? Seems like someone"},{"line_number":246,"context_line":"                # could delete the volume after this check passes but before"},{"line_number":247,"context_line":"                # the volume is offically created?"},{"line_number":248,"context_line":"                raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":249,"context_line":"            source_volid \u003d source_volume[\u0027id\u0027]"},{"line_number":250,"context_line":"        return source_volid"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2FpqY%3D","line":247,"updated":"2013-06-13 16:16:47.000000000","message":"As above, with a \u0027cloning\u0027 status","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"c73d60eef1aef629dacdeebe9ef0c88cbb89defa","unresolved":false,"context_lines":[{"line_number":244,"context_line":"                # TODO(harlowja): what happens if the status changes after this"},{"line_number":245,"context_line":"                # initial volume status check occurs??? Seems like someone"},{"line_number":246,"context_line":"                # could delete the volume after this check passes but before"},{"line_number":247,"context_line":"                # the volume is offically created?"},{"line_number":248,"context_line":"                raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":249,"context_line":"            source_volid \u003d source_volume[\u0027id\u0027]"},{"line_number":250,"context_line":"        return source_volid"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2Fo5c%3D","line":247,"in_reply_to":"AAAAPX%2F%2FpqY%3D","updated":"2013-06-13 18:20:02.000000000","message":"Agreed.","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1773,"name":"oliver-leahy-l","email":"oliver.leahy@hpe.com","username":"oliver-leahy-l"},"change_message_id":"36d5013efdff343903188c0bffa26bb2ce63afee","unresolved":false,"context_lines":[{"line_number":263,"context_line":"                   % size)"},{"line_number":264,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":265,"context_line":"        if source_volume and size \u003c source_volume[\u0027size\u0027]:"},{"line_number":266,"context_line":"            msg \u003d _(\"Clones currently must be \u003e\u003d original volume size.\")"},{"line_number":267,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":268,"context_line":"        return size"},{"line_number":269,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2Fpp0%3D","line":266,"updated":"2013-06-13 16:16:47.000000000","message":"I would include the two sizes in the error message here","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"c73d60eef1aef629dacdeebe9ef0c88cbb89defa","unresolved":false,"context_lines":[{"line_number":263,"context_line":"                   % size)"},{"line_number":264,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":265,"context_line":"        if source_volume and size \u003c source_volume[\u0027size\u0027]:"},{"line_number":266,"context_line":"            msg \u003d _(\"Clones currently must be \u003e\u003d original volume size.\")"},{"line_number":267,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":268,"context_line":"        return size"},{"line_number":269,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2Fo5M%3D","line":266,"in_reply_to":"AAAAPX%2F%2Fpp0%3D","updated":"2013-06-13 18:20:02.000000000","message":"Sounds good.","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1773,"name":"oliver-leahy-l","email":"oliver.leahy@hpe.com","username":"oliver-leahy-l"},"change_message_id":"36d5013efdff343903188c0bffa26bb2ce63afee","unresolved":false,"context_lines":[{"line_number":280,"context_line":"        # Check image size is not larger than volume size."},{"line_number":281,"context_line":"        image_size_in_gb \u003d (as_int(image_meta[\u0027size\u0027]) + GB - 1) / GB"},{"line_number":282,"context_line":"        if image_size_in_gb \u003e size:"},{"line_number":283,"context_line":"            msg \u003d _(\u0027Size of specified image is larger than volume size.\u0027)"},{"line_number":284,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"        # Check image minDisk requirement is met for the particular volume"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2FpoE%3D","line":283,"updated":"2013-06-13 16:16:47.000000000","message":"I would include sizes in the error messages","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"c73d60eef1aef629dacdeebe9ef0c88cbb89defa","unresolved":false,"context_lines":[{"line_number":280,"context_line":"        # Check image size is not larger than volume size."},{"line_number":281,"context_line":"        image_size_in_gb \u003d (as_int(image_meta[\u0027size\u0027]) + GB - 1) / GB"},{"line_number":282,"context_line":"        if image_size_in_gb \u003e size:"},{"line_number":283,"context_line":"            msg \u003d _(\u0027Size of specified image is larger than volume size.\u0027)"},{"line_number":284,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"        # Check image minDisk requirement is met for the particular volume"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2Fo5I%3D","line":283,"in_reply_to":"AAAAPX%2F%2FpoE%3D","updated":"2013-06-13 18:20:02.000000000","message":"+1","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1773,"name":"oliver-leahy-l","email":"oliver.leahy@hpe.com","username":"oliver-leahy-l"},"change_message_id":"36d5013efdff343903188c0bffa26bb2ce63afee","unresolved":false,"context_lines":[{"line_number":301,"context_line":"                LOG.warn(msg)"},{"line_number":302,"context_line":"                raise exception.InvalidVolumeMetadata(reason\u003dmsg)"},{"line_number":303,"context_line":"            if len(k) \u003e 255:"},{"line_number":304,"context_line":"                msg \u003d _(\"Metadata property key greater than 255 characters\")"},{"line_number":305,"context_line":"                LOG.warn(msg)"},{"line_number":306,"context_line":"                raise exception.InvalidVolumeMetadataSize(reason\u003dmsg)"},{"line_number":307,"context_line":"            if len(v) \u003e 255:"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2Fpn4%3D","line":304,"updated":"2013-06-13 16:16:47.000000000","message":"include the key in the message?","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1773,"name":"oliver-leahy-l","email":"oliver.leahy@hpe.com","username":"oliver-leahy-l"},"change_message_id":"36d5013efdff343903188c0bffa26bb2ce63afee","unresolved":false,"context_lines":[{"line_number":305,"context_line":"                LOG.warn(msg)"},{"line_number":306,"context_line":"                raise exception.InvalidVolumeMetadataSize(reason\u003dmsg)"},{"line_number":307,"context_line":"            if len(v) \u003e 255:"},{"line_number":308,"context_line":"                msg \u003d _(\"Metadata property value greater than 255 characters\")"},{"line_number":309,"context_line":"                LOG.warn(msg)"},{"line_number":310,"context_line":"                raise exception.InvalidVolumeMetadataSize(reason\u003dmsg)"},{"line_number":311,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2Fpnw%3D","line":308,"updated":"2013-06-13 16:16:47.000000000","message":"Include the key and/or value in the message?","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"b9b9cd3a288fe291d870f7c144a09bd60386ee30","unresolved":false,"context_lines":[{"line_number":305,"context_line":"                LOG.warn(msg)"},{"line_number":306,"context_line":"                raise exception.InvalidVolumeMetadataSize(reason\u003dmsg)"},{"line_number":307,"context_line":"            if len(v) \u003e 255:"},{"line_number":308,"context_line":"                msg \u003d _(\"Metadata property value greater than 255 characters\")"},{"line_number":309,"context_line":"                LOG.warn(msg)"},{"line_number":310,"context_line":"                raise exception.InvalidVolumeMetadataSize(reason\u003dmsg)"},{"line_number":311,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2FmPk%3D","line":308,"in_reply_to":"AAAAPX%2F%2Fpnw%3D","updated":"2013-06-14 17:16:44.000000000","message":"Both done.","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1773,"name":"oliver-leahy-l","email":"oliver.leahy@hpe.com","username":"oliver-leahy-l"},"change_message_id":"36d5013efdff343903188c0bffa26bb2ce63afee","unresolved":false,"context_lines":[{"line_number":339,"context_line":"            volume_type_id \u003d source_volume[\u0027volume_type_id\u0027]"},{"line_number":340,"context_line":"        else:"},{"line_number":341,"context_line":"            volume_type_id \u003d volume_type.get(\u0027id\u0027)"},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"        self._check_metadata_properties(metadata)"},{"line_number":344,"context_line":""},{"line_number":345,"context_line":"        return dict(size\u003dsize,"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2Fpf8%3D","line":342,"updated":"2013-06-13 16:16:47.000000000","message":"I think that the pair of if statements above are equivalent to these, but possibly not as clear:\n\nif volume_type;\n  # take type id from the function parameter volume_type\nelif source_volume:\n  # take type id from source volume\nelse\n  # otherwise take default","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"c73d60eef1aef629dacdeebe9ef0c88cbb89defa","unresolved":false,"context_lines":[{"line_number":339,"context_line":"            volume_type_id \u003d source_volume[\u0027volume_type_id\u0027]"},{"line_number":340,"context_line":"        else:"},{"line_number":341,"context_line":"            volume_type_id \u003d volume_type.get(\u0027id\u0027)"},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"        self._check_metadata_properties(metadata)"},{"line_number":344,"context_line":""},{"line_number":345,"context_line":"        return dict(size\u003dsize,"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2Fo44%3D","line":342,"in_reply_to":"AAAAPX%2F%2Fpf8%3D","updated":"2013-06-13 18:20:02.000000000","message":"Will rejigger that part.","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1773,"name":"oliver-leahy-l","email":"oliver.leahy@hpe.com","username":"oliver-leahy-l"},"change_message_id":"36d5013efdff343903188c0bffa26bb2ce63afee","unresolved":false,"context_lines":[{"line_number":521,"context_line":"                allow_reschedule\u003dFalse,"},{"line_number":522,"context_line":"                snapshot_id\u003dsnapshot_id,"},{"line_number":523,"context_line":"                image_id\u003dimage_id)"},{"line_number":524,"context_line":"        return host"},{"line_number":525,"context_line":""},{"line_number":526,"context_line":"    def __call__(self, context, **kwargs):"},{"line_number":527,"context_line":"        scheduler_hints \u003d kwargs.pop(\u0027scheduler_hints\u0027, None)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2Fpb4%3D","line":524,"updated":"2013-06-13 16:16:47.000000000","message":"The return value is not being used","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"c73d60eef1aef629dacdeebe9ef0c88cbb89defa","unresolved":false,"context_lines":[{"line_number":521,"context_line":"                allow_reschedule\u003dFalse,"},{"line_number":522,"context_line":"                snapshot_id\u003dsnapshot_id,"},{"line_number":523,"context_line":"                image_id\u003dimage_id)"},{"line_number":524,"context_line":"        return host"},{"line_number":525,"context_line":""},{"line_number":526,"context_line":"    def __call__(self, context, **kwargs):"},{"line_number":527,"context_line":"        scheduler_hints \u003d kwargs.pop(\u0027scheduler_hints\u0027, None)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2Fo4w%3D","line":524,"in_reply_to":"AAAAPX%2F%2Fpb4%3D","updated":"2013-06-13 18:20:02.000000000","message":"Good point, haha. Let me check if it is needed to be used.","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1773,"name":"oliver-leahy-l","email":"oliver.leahy@hpe.com","username":"oliver-leahy-l"},"change_message_id":"36d5013efdff343903188c0bffa26bb2ce63afee","unresolved":false,"context_lines":[{"line_number":643,"context_line":"            # this happen at the scheduler itself and not before it gets"},{"line_number":644,"context_line":"            # sent to the scheduler? (since what happens if it never gets"},{"line_number":645,"context_line":"            # there??). It\u0027s almost like we need a status of \u0027on-the-way-to"},{"line_number":646,"context_line":"            # scheduler\u0027???"},{"line_number":647,"context_line":"            status \u003d {"},{"line_number":648,"context_line":"                \u0027status\u0027: \u0027creating\u0027,"},{"line_number":649,"context_line":"                \u0027scheduled_at\u0027: timeutils.utcnow(),"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2FpYQ%3D","line":646,"updated":"2013-06-13 16:16:47.000000000","message":"If this was true, would it not also be the case for EntryCreateTask\n\nBy the way, is there a danger that volumes will get stuck in rescheduling loops forever? If can we guard against that in some way?","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"c73d60eef1aef629dacdeebe9ef0c88cbb89defa","unresolved":false,"context_lines":[{"line_number":643,"context_line":"            # this happen at the scheduler itself and not before it gets"},{"line_number":644,"context_line":"            # sent to the scheduler? (since what happens if it never gets"},{"line_number":645,"context_line":"            # there??). It\u0027s almost like we need a status of \u0027on-the-way-to"},{"line_number":646,"context_line":"            # scheduler\u0027???"},{"line_number":647,"context_line":"            status \u003d {"},{"line_number":648,"context_line":"                \u0027status\u0027: \u0027creating\u0027,"},{"line_number":649,"context_line":"                \u0027scheduled_at\u0027: timeutils.utcnow(),"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2Fo4I%3D","line":646,"in_reply_to":"AAAAPX%2F%2FpYQ%3D","updated":"2013-06-13 18:20:02.000000000","message":"So there is code in the scheduler filter to prevent this. Its not included here since its in the scheduler filter driver. Likely it should be moved someday since I\u0027m not really sure what it is doing there...\n\nhttps://github.com/openstack/cinder/blob/master/cinder/scheduler/filter_scheduler.py#L156\n\nThats the current \u0027loop\u0027 stopping logic, it does seem really out of place there, and it seems to suffer from the same problem as nova here... https://bugs.launchpad.net/nova/+bug/1161661","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1773,"name":"oliver-leahy-l","email":"oliver.leahy@hpe.com","username":"oliver-leahy-l"},"change_message_id":"36d5013efdff343903188c0bffa26bb2ce63afee","unresolved":false,"context_lines":[{"line_number":769,"context_line":"        # the volume has been deleted before we got here then this should fail."},{"line_number":770,"context_line":"        #"},{"line_number":771,"context_line":"        # In the future we might want to have a lock on the volume_id so that"},{"line_number":772,"context_line":"        # the volume can not be deleted while its still being created?"},{"line_number":773,"context_line":"        volume_ref \u003d self.db.volume_get(context, volume_id)"},{"line_number":774,"context_line":"        volume_type_id \u003d volume_ref.get(\u0027volume_type_id\u0027)"},{"line_number":775,"context_line":"        vol_type \u003d self.db.volume_type_get(context, volume_type_id)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2FpTc%3D","line":772,"updated":"2013-06-13 16:16:47.000000000","message":"Actually it might be good to allow the user to delete a volume that is stuck in a creating state. But that might require some tweaking to the state machine here.","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"7466e176a9ef22314a3c49c7649411d210771057","unresolved":false,"context_lines":[{"line_number":769,"context_line":"        # the volume has been deleted before we got here then this should fail."},{"line_number":770,"context_line":"        #"},{"line_number":771,"context_line":"        # In the future we might want to have a lock on the volume_id so that"},{"line_number":772,"context_line":"        # the volume can not be deleted while its still being created?"},{"line_number":773,"context_line":"        volume_ref \u003d self.db.volume_get(context, volume_id)"},{"line_number":774,"context_line":"        volume_type_id \u003d volume_ref.get(\u0027volume_type_id\u0027)"},{"line_number":775,"context_line":"        vol_type \u003d self.db.volume_type_get(context, volume_type_id)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2FmRo%3D","line":772,"in_reply_to":"AAAAPX%2F%2Fm24%3D","updated":"2013-06-14 17:05:04.000000000","message":"All good :-)\n\nI think we need to tackle this issue pretty careful, yes volume status names can help, but even those aren\u0027t true locks, since once u do something like.\n\nif status \u003d\u003d \u0027Y\u0027:\n   Update status to \u0027Z\u0027\n\nAnd then you have secondary action also trying to modify v (delete for example), you start to get into the gray area of using a database as a locking mechanism, which yes can work \u0027most\u0027 of the time, but isn\u0027t bulletproof. \n\nNote that the above example if statement wouldn\u0027t even work (since there is a race there that is hard to see).\n\nSee: https://wiki.openstack.org/wiki/StructuredWorkflowLocks#Databases","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1773,"name":"oliver-leahy-l","email":"oliver.leahy@hpe.com","username":"oliver-leahy-l"},"change_message_id":"c5bc26ecb51de63ffa656899b848b3a86a2d3c52","unresolved":false,"context_lines":[{"line_number":769,"context_line":"        # the volume has been deleted before we got here then this should fail."},{"line_number":770,"context_line":"        #"},{"line_number":771,"context_line":"        # In the future we might want to have a lock on the volume_id so that"},{"line_number":772,"context_line":"        # the volume can not be deleted while its still being created?"},{"line_number":773,"context_line":"        volume_ref \u003d self.db.volume_get(context, volume_id)"},{"line_number":774,"context_line":"        volume_type_id \u003d volume_ref.get(\u0027volume_type_id\u0027)"},{"line_number":775,"context_line":"        vol_type \u003d self.db.volume_type_get(context, volume_type_id)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2Fm24%3D","line":772,"in_reply_to":"AAAAPX%2F%2Fo3Y%3D","updated":"2013-06-14 15:01:15.000000000","message":"I agree, I was just commenting on your comment :)  and saying that it\u0027s a bit more subtle than just preventing deletion once creation starts, so obviously you had thought of that. Again my instinct would be to control this using more volume \u0027status\u0027 names. But I\u0027m looking forward to seeing how you plan to do it.","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"c73d60eef1aef629dacdeebe9ef0c88cbb89defa","unresolved":false,"context_lines":[{"line_number":769,"context_line":"        # the volume has been deleted before we got here then this should fail."},{"line_number":770,"context_line":"        #"},{"line_number":771,"context_line":"        # In the future we might want to have a lock on the volume_id so that"},{"line_number":772,"context_line":"        # the volume can not be deleted while its still being created?"},{"line_number":773,"context_line":"        volume_ref \u003d self.db.volume_get(context, volume_id)"},{"line_number":774,"context_line":"        volume_type_id \u003d volume_ref.get(\u0027volume_type_id\u0027)"},{"line_number":775,"context_line":"        vol_type \u003d self.db.volume_type_get(context, volume_type_id)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2Fo3Y%3D","line":772,"in_reply_to":"AAAAPX%2F%2FpTc%3D","updated":"2013-06-13 18:20:02.000000000","message":"I think thats in the delete state machine, which isn\u0027t yet converted to a flow right?? That request shouldn\u0027t be able to delete things that are not \u0027avaialble\u0027 for example, although this brings back up the locking of resources concept and when can that lock be preemptively taken over (as u say stuck in creating should be preemptable by deleting).","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"6b7e508f492514dbe4f3375bd5cf5972cf3dacdb","unresolved":false,"context_lines":[{"line_number":960,"context_line":"                                                \u0027volume_id\u0027: volume_id})"},{"line_number":961,"context_line":"        image_service, image_id \u003d get_remote_image_service(context, image_href)"},{"line_number":962,"context_line":"        try:"},{"line_number":963,"context_line":"            copy_image_to_volume(context, volume_ref, image_service, image_id)"},{"line_number":964,"context_line":"        except exception.ProcessExecutionError as ex:"},{"line_number":965,"context_line":"            LOG.error(_(\"Failed to copy image to volume: %(volume_id)s, \""},{"line_number":966,"context_line":"                        \"error: %(error)s\") % {\u0027volume_id\u0027: volume_id,"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2FoYY%3D","line":963,"updated":"2013-06-13 22:15:18.000000000","message":"#TODO Make this another job/flow that is serially executed and required to finish before going on here.\n\nThis is usually an involved process, \n(hight level)\nattach volume to cinder node\ndd the image to the volume\ndetach the volume.","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"7466e176a9ef22314a3c49c7649411d210771057","unresolved":false,"context_lines":[{"line_number":960,"context_line":"                                                \u0027volume_id\u0027: volume_id})"},{"line_number":961,"context_line":"        image_service, image_id \u003d get_remote_image_service(context, image_href)"},{"line_number":962,"context_line":"        try:"},{"line_number":963,"context_line":"            copy_image_to_volume(context, volume_ref, image_service, image_id)"},{"line_number":964,"context_line":"        except exception.ProcessExecutionError as ex:"},{"line_number":965,"context_line":"            LOG.error(_(\"Failed to copy image to volume: %(volume_id)s, \""},{"line_number":966,"context_line":"                        \"error: %(error)s\") % {\u0027volume_id\u0027: volume_id,"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2FmRc%3D","line":963,"in_reply_to":"AAAAPX%2F%2FoYY%3D","updated":"2013-06-14 17:05:04.000000000","message":"Agreed, hooked that into the next commit as well as:\n\nhttps://blueprints.launchpad.net/taskflow/+spec/dynamic-subs\n\nWe\u0027ll see how this turns out.","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":1773,"name":"oliver-leahy-l","email":"oliver.leahy@hpe.com","username":"oliver-leahy-l"},"change_message_id":"36d5013efdff343903188c0bffa26bb2ce63afee","unresolved":false,"context_lines":[{"line_number":1005,"context_line":"                # failing of setting an individual key/value fails. If they"},{"line_number":1006,"context_line":"                # all fail then likely something is majorly wrong but it would"},{"line_number":1007,"context_line":"                # seem the volume should still continue being created and not"},{"line_number":1008,"context_line":"                # errored out??"},{"line_number":1009,"context_line":"                LOG.exception(_(\"Failed setting volume glance metadata %(key)s\""},{"line_number":1010,"context_line":"                                \" to %(value)s for volume %(volume_id)s\") % {"},{"line_number":1011,"context_line":"                                    \u0027volume_id\u0027: volume_id,"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAPX%2F%2FpOk%3D","line":1008,"updated":"2013-06-13 16:16:47.000000000","message":"yep","commit_id":"0cadba6b5f6234b0294e2001b4eb2699ed465986"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"5f77cb1770ddf28ce7b92c1c4c8e01c6f7699aff","unresolved":false,"context_lines":[{"line_number":1025,"context_line":"            # clone image \u0027path\u0027 resumable and revertable in the correct"},{"line_number":1026,"context_line":"            # manner. Avoiding this for now..."},{"line_number":1027,"context_line":"            #"},{"line_number":1028,"context_line":"            # Create the volume and then download the image onto the volume."},{"line_number":1029,"context_line":"            model_update \u003d self.driver.create_volume(volume_ref)"},{"line_number":1030,"context_line":"            try:"},{"line_number":1031,"context_line":"                updates \u003d {}"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAPX%2F%2FmMo%3D","line":1028,"updated":"2013-06-14 17:34:20.000000000","message":"In this case the steps for copying an image to a volume are always the same.  So the \u0027subflow\u0027 here doesn\u0027t need to be dynamic, but statically defined.   We need a way of attaching a flow to a task and when the conditions are met inside the task, it should hand off execution to the subflow.  Recovery could be picked up by going to the subflows execution state.","commit_id":"924e8ce67147b3d1eb5cb9033c9e6b2b7d69b914"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"80b619939ef0ebd7a35fbc2029812625074ede9b","unresolved":false,"context_lines":[{"line_number":1025,"context_line":"            # clone image \u0027path\u0027 resumable and revertable in the correct"},{"line_number":1026,"context_line":"            # manner. Avoiding this for now..."},{"line_number":1027,"context_line":"            #"},{"line_number":1028,"context_line":"            # Create the volume and then download the image onto the volume."},{"line_number":1029,"context_line":"            model_update \u003d self.driver.create_volume(volume_ref)"},{"line_number":1030,"context_line":"            try:"},{"line_number":1031,"context_line":"                updates \u003d {}"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAPX%2F%2FmLI%3D","line":1028,"in_reply_to":"AAAAPX%2F%2FmMo%3D","updated":"2013-06-14 17:50:04.000000000","message":"Agreed, its not really dynamic. Its just a statically defined \u0027side-path\u0027 as u described that only gets followed based on some dynamic decision. It is likely that I can actually adjust the workflow pretty easily to split like this I think but maybe wait till phase 2 for that ;)","commit_id":"924e8ce67147b3d1eb5cb9033c9e6b2b7d69b914"},{"author":{"_account_id":1773,"name":"oliver-leahy-l","email":"oliver.leahy@hpe.com","username":"oliver-leahy-l"},"change_message_id":"e287eb30936e1e224c841a535e1c0c898209aae2","unresolved":false,"context_lines":[{"line_number":904,"context_line":"            # TODO(harlowja): verify this *new* logic is ok."},{"line_number":905,"context_line":"            #"},{"line_number":906,"context_line":"            # Don\u0027t set the instance to error if just the metadata copying"},{"line_number":907,"context_line":"            # failed since the volume will already be created at this point."},{"line_number":908,"context_line":"            LOG.exception(_(\"Failed updating volume %(volume_id)s metadata\""},{"line_number":909,"context_line":"                            \" using the provided glance snapshot \""},{"line_number":910,"context_line":"                            \"%(snapshot_id)s metadata\") %"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAAPn%2F%2F6hQ%3D","line":907,"updated":"2013-06-18 12:20:22.000000000","message":"I think that if we fail to copy  glance metadata for a volume we shouldn\u0027t report success to the user. I\u0027m not exactly sure what happens higher up the call stack here, so maybe this is being handled correctly.\n\nYou\u0027re probably aware that one use case for glance metadata is to create a persistent instance from a glance image. If we create a volume for a glance instance and fail to set the glance metadata then the user won\u0027t be able to boot the instance, at least not from the cli or gui. There is also the side problem that billing information related to that glance image won\u0027t be available for the persistent instance we\u0027ve just created.","commit_id":"54444fbf89b350a6a62c6ea9d91701ad9c407889"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"12d83ffdf7ce4616f84e3cde51f3689120628e06","unresolved":false,"context_lines":[{"line_number":904,"context_line":"            # TODO(harlowja): verify this *new* logic is ok."},{"line_number":905,"context_line":"            #"},{"line_number":906,"context_line":"            # Don\u0027t set the instance to error if just the metadata copying"},{"line_number":907,"context_line":"            # failed since the volume will already be created at this point."},{"line_number":908,"context_line":"            LOG.exception(_(\"Failed updating volume %(volume_id)s metadata\""},{"line_number":909,"context_line":"                            \" using the provided glance snapshot \""},{"line_number":910,"context_line":"                            \"%(snapshot_id)s metadata\") %"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAAPn%2F%2F5oY%3D","line":907,"in_reply_to":"AAAAPn%2F%2F6hQ%3D","updated":"2013-06-18 18:26:00.000000000","message":"Yup, IMO this is a bug in the current code... also exists in the clone code IIRC.","commit_id":"54444fbf89b350a6a62c6ea9d91701ad9c407889"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"7b56aac36f6cd560cf4a7539784e353e404b8844","unresolved":false,"context_lines":[{"line_number":1579,"context_line":"    # arguments."},{"line_number":1580,"context_line":""},{"line_number":1581,"context_line":"    @decorators.task"},{"line_number":1582,"context_line":"    def schedule_create_volume(context, request_spec, filter_properties):"},{"line_number":1583,"context_line":"        driver.schedule_create_volume(context, request_spec, filter_properties)"},{"line_number":1584,"context_line":""},{"line_number":1585,"context_line":"    scheduler_flow.add(schedule_create_volume)"}],"source_content_type":"text/x-python","patch_set":62,"id":"AAAAQn%2F%2FFDk%3D","line":1582,"updated":"2013-08-07 14:49:10.000000000","message":"These scheduler tasks can raise things like NoValidHost, we should catch these here I think, possibly some other spots as well but this particular case is a common one.","commit_id":"5a7b2129a055b521e6e45d3c5d450af03fdd4808"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"f335db745c6574be672203760401eca886285fb8","unresolved":false,"context_lines":[{"line_number":1579,"context_line":"    # arguments."},{"line_number":1580,"context_line":""},{"line_number":1581,"context_line":"    @decorators.task"},{"line_number":1582,"context_line":"    def schedule_create_volume(context, request_spec, filter_properties):"},{"line_number":1583,"context_line":"        driver.schedule_create_volume(context, request_spec, filter_properties)"},{"line_number":1584,"context_line":""},{"line_number":1585,"context_line":"    scheduler_flow.add(schedule_create_volume)"}],"source_content_type":"text/x-python","patch_set":62,"id":"AAAAQn%2F%2FDok%3D","line":1582,"in_reply_to":"AAAAQn%2F%2FFDk%3D","updated":"2013-08-07 19:59:49.000000000","message":"Ok, I think I understand what u want here.\n\nIf i catch this, then rethrow a \u0027Scheduling failure\u0027 is that fine. The issue with catching it and dropping it (or just logging it) is that the flow will continue moving forward (thinking everything is ok). Then NotifySchedulerFailureTask won\u0027t get called in its reverting method. I could move the logic for NotifySchedulerFailureTask to here though. Thoughts??\n\nThat might make sense since then its more obvious that this exception is getting handled \u0027right way\u0027 instead of by the reverting method of NotifySchedulerFailureTask.","commit_id":"5a7b2129a055b521e6e45d3c5d450af03fdd4808"}],"cinder/volume/manager.py":[{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"dc3a28c96e5e452bb8cf11ed018a92b729c3b850","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        if filter_properties is None:"},{"line_number":204,"context_line":"            filter_properties \u003d {}"},{"line_number":205,"context_line":"        volume_ref \u003d self.db.volume_get(context, volume_id)"},{"line_number":206,"context_line":"        self._notify_about_volume_usage(context, volume_ref, \"create.start\")"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"        # NOTE(vish): so we don\u0027t have to get volume from db again"},{"line_number":209,"context_line":"        #             before passing it to the driver."}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAAPn%2F%2F04U%3D","side":"PARENT","line":206,"updated":"2013-06-20 10:28:57.000000000","message":"These notifications have now been removed. Not sure what they are consumed by off the top of my head, but removing them without noting this fact is bad...","commit_id":"ee74a17401d5ce76ef294210857274ba4961cc9f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"e86f1daa955aa13cd67f195e1c7e5b526ee2c6f5","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        if filter_properties is None:"},{"line_number":204,"context_line":"            filter_properties \u003d {}"},{"line_number":205,"context_line":"        volume_ref \u003d self.db.volume_get(context, volume_id)"},{"line_number":206,"context_line":"        self._notify_about_volume_usage(context, volume_ref, \"create.start\")"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"        # NOTE(vish): so we don\u0027t have to get volume from db again"},{"line_number":209,"context_line":"        #             before passing it to the driver."}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAAPn%2F%2Fz1M%3D","side":"PARENT","line":206,"in_reply_to":"AAAAPn%2F%2F04U%3D","updated":"2013-06-20 17:37:45.000000000","message":"Afaik they haven\u0027t been removed ;)\n\nThey are now part of the overall flow itself instead. :)","commit_id":"ee74a17401d5ce76ef294210857274ba4961cc9f"}]}
