)]}'
{"openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/keypair/create-keypair.service.js":[{"author":{"_account_id":14124,"name":"Matt Borland","email":"matt.borland@hpe.com","username":"mborland"},"change_message_id":"18246ff50fa134bc47d240dcc26db4b9b44b49f7","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    function addDOMResource(keypairName) {"},{"line_number":40,"context_line":"      var url \u003d constructKeyPairDownloadUrl(keypairName);"},{"line_number":41,"context_line":"      $document.find(\u0027body\u0027).append("},{"line_number":42,"context_line":"        \"\u003ciframe id\u003d\" + keypairName + \" src\u003d\u0027\" + url +"},{"line_number":43,"context_line":"        \"\u0027 style\u003d\u0027display: none;\u0027 \u003e\u003c/iframe\u003e\""},{"line_number":44,"context_line":"      );"}],"source_content_type":"text/javascript","patch_set":3,"id":"fa69d971_3f842d09","line":41,"range":{"start_line":41,"start_character":6,"end_line":41,"end_character":15},"updated":"2016-01-06 14:31:34.000000000","message":"It seems odd to have presentation-level objects embedded here.  I prefer to handle this a different way, such as streaming a file down via a data: href rather than doing this, which would clean up the separation of service from presentation.","commit_id":"d1431ad667d825f595cc77bb229fe312a3a9e9d4"},{"author":{"_account_id":14124,"name":"Matt Borland","email":"matt.borland@hpe.com","username":"mborland"},"change_message_id":"b86f898d6a2a4a8de502261ccf7954ca1719a01d","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    function addDOMResource(keypairName) {"},{"line_number":40,"context_line":"      var url \u003d constructKeyPairDownloadUrl(keypairName);"},{"line_number":41,"context_line":"      $document.find(\u0027body\u0027).append("},{"line_number":42,"context_line":"        \"\u003ciframe id\u003d\" + keypairName + \" src\u003d\u0027\" + url +"},{"line_number":43,"context_line":"        \"\u0027 style\u003d\u0027display: none;\u0027 \u003e\u003c/iframe\u003e\""},{"line_number":44,"context_line":"      );"}],"source_content_type":"text/javascript","patch_set":3,"id":"fa69d971_c57acd23","line":41,"range":{"start_line":41,"start_character":6,"end_line":41,"end_character":15},"in_reply_to":"fa69d971_3f842d09","updated":"2016-01-06 21:59:43.000000000","message":"To be clear, I\u0027m OK with this, but would prefer if there were a cleaner way. :)","commit_id":"d1431ad667d825f595cc77bb229fe312a3a9e9d4"},{"author":{"_account_id":18508,"name":"Errol Pais","email":"errol.pais@protonmail.com","username":"errol"},"change_message_id":"eaf5e835c79674d771e78ba72151373c38d41153","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    function addDOMResource(keypairName) {"},{"line_number":40,"context_line":"      var url \u003d constructKeyPairDownloadUrl(keypairName);"},{"line_number":41,"context_line":"      $document.find(\u0027body\u0027).append("},{"line_number":42,"context_line":"        \"\u003ciframe id\u003d\" + keypairName + \" src\u003d\u0027\" + url +"},{"line_number":43,"context_line":"        \"\u0027 style\u003d\u0027display: none;\u0027 \u003e\u003c/iframe\u003e\""},{"line_number":44,"context_line":"      );"}],"source_content_type":"text/javascript","patch_set":3,"id":"fa69d971_d89fe44e","line":41,"range":{"start_line":41,"start_character":6,"end_line":41,"end_character":15},"in_reply_to":"fa69d971_c57acd23","updated":"2016-01-07 19:53:27.000000000","message":"Agree that its not ideal. Its surprisingly hard to find a cross browser solution to download a file. Open to better ideas if anyone has any but this is the cleanest that I could find so far.","commit_id":"d1431ad667d825f595cc77bb229fe312a3a9e9d4"},{"author":{"_account_id":14124,"name":"Matt Borland","email":"matt.borland@hpe.com","username":"mborland"},"change_message_id":"18246ff50fa134bc47d240dcc26db4b9b44b49f7","unresolved":false,"context_lines":[{"line_number":50,"context_line":"          novaAPI.getKeypairs().then(function (response) {"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"            var foundKeypairs \u003d response.data.items.filter(function sameName(item) {"},{"line_number":53,"context_line":"              return item.keypair.name \u003d\u003d\u003d name;"},{"line_number":54,"context_line":"            });"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"            if (foundKeypairs.length \u003d\u003d\u003d 1) {"}],"source_content_type":"text/javascript","patch_set":3,"id":"fa69d971_dfcdd166","line":53,"updated":"2016-01-06 14:31:34.000000000","message":"Will the slugify on the API possibly cause these values not to match?","commit_id":"d1431ad667d825f595cc77bb229fe312a3a9e9d4"},{"author":{"_account_id":18508,"name":"Errol Pais","email":"errol.pais@protonmail.com","username":"errol"},"change_message_id":"eaf5e835c79674d771e78ba72151373c38d41153","unresolved":false,"context_lines":[{"line_number":50,"context_line":"          novaAPI.getKeypairs().then(function (response) {"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"            var foundKeypairs \u003d response.data.items.filter(function sameName(item) {"},{"line_number":53,"context_line":"              return item.keypair.name \u003d\u003d\u003d name;"},{"line_number":54,"context_line":"            });"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"            if (foundKeypairs.length \u003d\u003d\u003d 1) {"}],"source_content_type":"text/javascript","patch_set":3,"id":"fa69d971_780278b6","line":53,"in_reply_to":"fa69d971_dfcdd166","updated":"2016-01-07 19:53:27.000000000","message":"This API call does not involve a slugify so I think we should be alright. you can see the implementation here: https://github.com/openstack/horizon/blob/master/openstack_dashboard/api/rest/nova.py#L33","commit_id":"d1431ad667d825f595cc77bb229fe312a3a9e9d4"},{"author":{"_account_id":14124,"name":"Matt Borland","email":"matt.borland@hpe.com","username":"mborland"},"change_message_id":"56f083398fa12b11b9c12db05e229ecd54ab5775","unresolved":false,"context_lines":[{"line_number":62,"context_line":""},{"line_number":63,"context_line":"          });"},{"line_number":64,"context_line":"        },"},{"line_number":65,"context_line":"        1000"},{"line_number":66,"context_line":"        );"},{"line_number":67,"context_line":"      });"},{"line_number":68,"context_line":"    }"}],"source_content_type":"text/javascript","patch_set":6,"id":"da6ed579_cb973738","line":65,"range":{"start_line":65,"start_character":8,"end_line":65,"end_character":12},"updated":"2016-01-15 15:08:36.000000000","message":"I\u0027m finding this timeout to be too short.  I notice that on my somewhat slow machine, I will more often than not get an error as the timeout period is exceeded.  Any number of items may interfere here, so suggest quite a few seconds.","commit_id":"a7d9de8e6d0b67ee3b5df810c383ab25ff88f6bc"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"ded4f22f0604c7ab5c1f303e3acec6fa69206d01","unresolved":false,"context_lines":[{"line_number":12,"context_line":"  angular"},{"line_number":13,"context_line":"    .module(\u0027horizon.dashboard.project.workflow.launch-instance\u0027)"},{"line_number":14,"context_line":"    .factory(\u0027horizon.dashboard.project.workflow.launch-instance.keypair.create-keypair-service\u0027,"},{"line_number":15,"context_line":"      createKeypairService);"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"  createKeypairService.$inject \u003d ["},{"line_number":18,"context_line":"    \u0027$document\u0027,"}],"source_content_type":"text/javascript","patch_set":7,"id":"da6ed579_ac5a0b29","line":15,"updated":"2016-01-15 19:47:38.000000000","message":"What are your thoughts on why your put this here?Shouldn\u0027t it be in:\n\nhorizon/openstack_dashboard/static/app/core/openstack-service-api/nova.service.js\n\nAnd it needs to somehow resolve with the existing keypair functions in that service:\n\nhttps://github.com/openstack/horizon/blob/master/openstack_dashboard/static/app/core/openstack-service-api/nova.service.js#L78-L115","commit_id":"ea59833abba749ad53b60527cc4f9d95969eae57"},{"author":{"_account_id":18508,"name":"Errol Pais","email":"errol.pais@protonmail.com","username":"errol"},"change_message_id":"5f298fe398b1d95660a496f5f11e2b60b7ababb1","unresolved":false,"context_lines":[{"line_number":12,"context_line":"  angular"},{"line_number":13,"context_line":"    .module(\u0027horizon.dashboard.project.workflow.launch-instance\u0027)"},{"line_number":14,"context_line":"    .factory(\u0027horizon.dashboard.project.workflow.launch-instance.keypair.create-keypair-service\u0027,"},{"line_number":15,"context_line":"      createKeypairService);"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"  createKeypairService.$inject \u003d ["},{"line_number":18,"context_line":"    \u0027$document\u0027,"}],"source_content_type":"text/javascript","patch_set":7,"id":"da6ed579_9e3f2987","line":15,"in_reply_to":"da6ed579_ac5a0b29","updated":"2016-01-18 19:24:22.000000000","message":"The thought was that the functions in the nova.service.js was the javascript layer with the single responsibility of encapsulating calls to the django nova service api. \n\nThe functions in this service, make use of those calls but they also perform other tasks to manipulate and define the model at the UI level.","commit_id":"ea59833abba749ad53b60527cc4f9d95969eae57"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"ded4f22f0604c7ab5c1f303e3acec6fa69206d01","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    }"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    function verifyKeypairCreation(name) {"},{"line_number":49,"context_line":"      return $q(function(resolve, reject) {"},{"line_number":50,"context_line":"        $timeout(function() {"},{"line_number":51,"context_line":"          novaAPI.getKeypairs().then(function (response) {"},{"line_number":52,"context_line":""}],"source_content_type":"text/javascript","patch_set":7,"id":"da6ed579_292b6d96","line":49,"updated":"2016-01-15 19:47:38.000000000","message":"should be named function as per style guide.  Ditto below.","commit_id":"ea59833abba749ad53b60527cc4f9d95969eae57"},{"author":{"_account_id":18508,"name":"Errol Pais","email":"errol.pais@protonmail.com","username":"errol"},"change_message_id":"5f298fe398b1d95660a496f5f11e2b60b7ababb1","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    }"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    function verifyKeypairCreation(name) {"},{"line_number":49,"context_line":"      return $q(function(resolve, reject) {"},{"line_number":50,"context_line":"        $timeout(function() {"},{"line_number":51,"context_line":"          novaAPI.getKeypairs().then(function (response) {"},{"line_number":52,"context_line":""}],"source_content_type":"text/javascript","patch_set":7,"id":"ba63e191_fd08ab93","line":49,"in_reply_to":"da6ed579_292b6d96","updated":"2016-01-18 19:24:22.000000000","message":"Done","commit_id":"ea59833abba749ad53b60527cc4f9d95969eae57"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"ded4f22f0604c7ab5c1f303e3acec6fa69206d01","unresolved":false,"context_lines":[{"line_number":62,"context_line":""},{"line_number":63,"context_line":"          });"},{"line_number":64,"context_line":"        },"},{"line_number":65,"context_line":"        2000"},{"line_number":66,"context_line":"        );"},{"line_number":67,"context_line":"      });"},{"line_number":68,"context_line":"    }"}],"source_content_type":"text/javascript","patch_set":7,"id":"da6ed579_e94d559a","line":65,"updated":"2016-01-15 19:47:38.000000000","message":"hmm, maybe it would be better to put this in a loop and check more frequently. Maybe check every second and retry 10 times?","commit_id":"ea59833abba749ad53b60527cc4f9d95969eae57"},{"author":{"_account_id":18508,"name":"Errol Pais","email":"errol.pais@protonmail.com","username":"errol"},"change_message_id":"5f298fe398b1d95660a496f5f11e2b60b7ababb1","unresolved":false,"context_lines":[{"line_number":62,"context_line":""},{"line_number":63,"context_line":"          });"},{"line_number":64,"context_line":"        },"},{"line_number":65,"context_line":"        2000"},{"line_number":66,"context_line":"        );"},{"line_number":67,"context_line":"      });"},{"line_number":68,"context_line":"    }"}],"source_content_type":"text/javascript","patch_set":7,"id":"ba63e191_dd2a87e7","line":65,"in_reply_to":"da6ed579_120252b5","updated":"2016-01-18 19:24:22.000000000","message":"Me too! Done.","commit_id":"ea59833abba749ad53b60527cc4f9d95969eae57"},{"author":{"_account_id":14124,"name":"Matt Borland","email":"matt.borland@hpe.com","username":"mborland"},"change_message_id":"13c8f95d703df5f3e60b8b7d98c8874ed5cb694d","unresolved":false,"context_lines":[{"line_number":62,"context_line":""},{"line_number":63,"context_line":"          });"},{"line_number":64,"context_line":"        },"},{"line_number":65,"context_line":"        2000"},{"line_number":66,"context_line":"        );"},{"line_number":67,"context_line":"      });"},{"line_number":68,"context_line":"    }"}],"source_content_type":"text/javascript","patch_set":7,"id":"da6ed579_120252b5","line":65,"in_reply_to":"da6ed579_e94d559a","updated":"2016-01-15 20:41:33.000000000","message":"That would make me a little happier. :)","commit_id":"ea59833abba749ad53b60527cc4f9d95969eae57"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"3252051038057321c44b9fe505d238c44f54415c","unresolved":false,"context_lines":[{"line_number":12,"context_line":"  angular"},{"line_number":13,"context_line":"    .module(\u0027horizon.dashboard.project.workflow.launch-instance\u0027)"},{"line_number":14,"context_line":"    .factory(\u0027horizon.dashboard.project.workflow.launch-instance.keypair.create-keypair-service\u0027,"},{"line_number":15,"context_line":"      createKeypairService);"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"  createKeypairService.$inject \u003d ["},{"line_number":18,"context_line":"    \u0027$document\u0027,"}],"source_content_type":"text/javascript","patch_set":9,"id":"ba63e191_bfc0ab7d","line":15,"updated":"2016-01-19 17:30:25.000000000","message":"Thanks for the explanation in PS 7 on why you put this here. I\u0027m quite on the fence about not putting this into the common API module. Will need to think about it and am hoping to get some opinion on this from Thai or Richard.","commit_id":"7801fb1cb0d55c62bea1df6ca74eb2bd6ff7e2ba"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"3252051038057321c44b9fe505d238c44f54415c","unresolved":false,"context_lines":[{"line_number":78,"context_line":"      return \"/api/nova/keypairs/\" + keyPairName + \"/\";"},{"line_number":79,"context_line":"    }"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    function constructKeyPairRedownloadUrl(keyPairName) {"},{"line_number":82,"context_line":"      return \"/api/nova/keypairs/\" + keyPairName + \"/?regenerate\u003dtrue\";"},{"line_number":83,"context_line":"    }"},{"line_number":84,"context_line":"  }"}],"source_content_type":"text/javascript","patch_set":9,"id":"ba63e191_ff5aa329","line":81,"updated":"2016-01-19 17:30:25.000000000","message":"This isn\u0027t simply re-\"Download\". This actually has quite a big impact in that the keypair will be recreated and will potentially cause issues for any instances already deployed with the old keypair using that name. Essentially, if you were to just replace your local keypair files with the same name as the newly downloaded keypair, any instances that already are started and have the old key will seem to not be accessible to you anymore.\n\nTherefore, this function should really have a name that reflects this and a description that helps people to understand the impact. I also hope (haven\u0027t looked yet) that the UI using this feature makes this impact clear to the user.","commit_id":"7801fb1cb0d55c62bea1df6ca74eb2bd6ff7e2ba"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"d9a776ab045ec9fae3f8a9bc887c2fea588d2731","unresolved":false,"context_lines":[{"line_number":78,"context_line":"      return \"/api/nova/keypairs/\" + keyPairName + \"/\";"},{"line_number":79,"context_line":"    }"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    function constructKeyPairRedownloadUrl(keyPairName) {"},{"line_number":82,"context_line":"      return \"/api/nova/keypairs/\" + keyPairName + \"/?regenerate\u003dtrue\";"},{"line_number":83,"context_line":"    }"},{"line_number":84,"context_line":"  }"}],"source_content_type":"text/javascript","patch_set":9,"id":"9a68dd71_d25f31e3","line":81,"in_reply_to":"ba63e191_daac8a37","updated":"2016-01-23 05:11:47.000000000","message":"Yes. That works.","commit_id":"7801fb1cb0d55c62bea1df6ca74eb2bd6ff7e2ba"},{"author":{"_account_id":18508,"name":"Errol Pais","email":"errol.pais@protonmail.com","username":"errol"},"change_message_id":"38a495a430c553db5c3bda48a947bbc107bd5333","unresolved":false,"context_lines":[{"line_number":78,"context_line":"      return \"/api/nova/keypairs/\" + keyPairName + \"/\";"},{"line_number":79,"context_line":"    }"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    function constructKeyPairRedownloadUrl(keyPairName) {"},{"line_number":82,"context_line":"      return \"/api/nova/keypairs/\" + keyPairName + \"/?regenerate\u003dtrue\";"},{"line_number":83,"context_line":"    }"},{"line_number":84,"context_line":"  }"}],"source_content_type":"text/javascript","patch_set":9,"id":"ba63e191_daac8a37","line":81,"in_reply_to":"ba63e191_ff5aa329","updated":"2016-01-19 18:45:02.000000000","message":"Does constructKeyPairRegenerateUrl work? \n\nThere is a clash of what the UI is offering (redownload) and what the relevant action is actually doing (regenerating). \n\nSo to answer your question, the UI isn\u0027t explaining this to the user which I can agree is not good, and can/should be fixed by changing the wording. \n\nI am not as worried about the issue with replacing keypairs that are already assigned to instances. The regeneration action is only provided to the user just after the user has created the keypair which makes the assumption that the user has not had a chance to associate the keypairs yet. Not saying that its not possible but its more unlikely but the rewording should make it clearer.","commit_id":"7801fb1cb0d55c62bea1df6ca74eb2bd6ff7e2ba"},{"author":{"_account_id":14124,"name":"Matt Borland","email":"matt.borland@hpe.com","username":"mborland"},"change_message_id":"561aff3e1510f6194ee177c469031e9e707f80a5","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    function addDOMResource(keypairName) {"},{"line_number":41,"context_line":"      var url \u003d constructKeyPairDownloadUrl(keypairName);"},{"line_number":42,"context_line":"      $document.find(\u0027body\u0027).append("},{"line_number":43,"context_line":"        \"\u003ciframe id\u003d\" + keypairName + \" src\u003d\u0027\" + url +"},{"line_number":44,"context_line":"        \"\u0027 style\u003d\u0027display: none;\u0027 \u003e\u003c/iframe\u003e\""},{"line_number":45,"context_line":"      );"},{"line_number":46,"context_line":"    }"}],"source_content_type":"text/javascript","patch_set":10,"id":"9a68dd71_e707d915","line":43,"range":{"start_line":43,"start_character":45,"end_line":43,"end_character":54},"updated":"2016-01-25 17:25:47.000000000","message":"I\u0027m guessing this doesn\u0027t work with WEBROOT.","commit_id":"171b5a09f6f33bddadf73304dedfedfabeda3083"},{"author":{"_account_id":14124,"name":"Matt Borland","email":"matt.borland@hpe.com","username":"mborland"},"change_message_id":"cbfde13384869db1629e4149bb580deace43aef3","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    }"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    function constructKeyPairRedownloadUrl(keyPairName) {"},{"line_number":82,"context_line":"      return \"/api/nova/keypairs/\" + keyPairName + \"/?regenerate\u003dtrue\";"},{"line_number":83,"context_line":"    }"},{"line_number":84,"context_line":"  }"},{"line_number":85,"context_line":"})();"}],"source_content_type":"text/javascript","patch_set":10,"id":"9a68dd71_5c99cb77","line":82,"range":{"start_line":82,"start_character":37,"end_line":82,"end_character":48},"updated":"2016-01-25 22:34:17.000000000","message":"I wonder what happens if there are slashes in the name.","commit_id":"171b5a09f6f33bddadf73304dedfedfabeda3083"}],"openstack_dashboard/static/app/core/openstack-service-api/keypair-download.service.js":[{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"ca08269c3596187dce3dc16346e9572a0caefb76","unresolved":false,"context_lines":[{"line_number":1,"context_line":"(function () {"},{"line_number":2,"context_line":"  \u0027use strict\u0027;"},{"line_number":3,"context_line":""},{"line_number":4,"context_line":"  /**"}],"source_content_type":"text/javascript","patch_set":14,"id":"7a5de9d1_e373be13","line":1,"updated":"2016-01-29 04:30:22.000000000","message":"All files are supposed to have apache license and copyright.","commit_id":"2866230526d966dea31282e1ca1fd053acf1f881"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"ca08269c3596187dce3dc16346e9572a0caefb76","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    return service;"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    ////////////////////////////"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    function createAndDownloadKeypair(name) {"},{"line_number":35,"context_line":"      addDOMResource(name);"},{"line_number":36,"context_line":"      return verifyCreatedPromise(name);"}],"source_content_type":"text/javascript","patch_set":14,"id":"7a5de9d1_c3824294","line":33,"updated":"2016-01-29 04:30:22.000000000","message":"Function documentation is missing in here.  This is a rather odd service due to what had to be done with making it browser compatible.  This shouldn\u0027t be lost.","commit_id":"2866230526d966dea31282e1ca1fd053acf1f881"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"1efeed75df5e1a62acfcdec5be4581417b71b20a","unresolved":false,"context_lines":[{"line_number":69,"context_line":"     * the create API call given, so the results are streamed directly to the"},{"line_number":70,"context_line":"     * client.  This is not ideal but is due to lack of support in IE for"},{"line_number":71,"context_line":"     * features like the data: protocol."},{"line_number":72,"context_line":"     *"},{"line_number":73,"context_line":"     * @param {string} name The desired name for the key pair"},{"line_number":74,"context_line":"     */"},{"line_number":75,"context_line":"    function createAndDownloadKeypair(name) {"}],"source_content_type":"text/javascript","patch_set":15,"id":"7a5de9d1_075126d8","line":72,"updated":"2016-01-29 16:35:23.000000000","message":"Well the nice thing about this being in a reusable service is that if browser support improves, this can later be updated here without affecting every user of it.","commit_id":"693407e9370a7c2b6ca2efcdf56a90167399e012"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"124a9f61e5e5f7e8356879574c33f6c628d857bf","unresolved":false,"context_lines":[{"line_number":88,"context_line":"     * @param {string} keypairName The desired name for the key pair"},{"line_number":89,"context_line":"     */"},{"line_number":90,"context_line":"    function addDOMResource(keypairName) {"},{"line_number":91,"context_line":"      var url \u003d novaAPI.getCreateKeypairUrl(keypairName);"},{"line_number":92,"context_line":"      $document.find(\u0027body\u0027).append("},{"line_number":93,"context_line":"        \"\u003ciframe id\u003d\" + keypairName + \" src\u003d\u0027\" + url +"},{"line_number":94,"context_line":"        \"\u0027 style\u003d\u0027display: none;\u0027 \u003e\u003c/iframe\u003e\""}],"source_content_type":"text/javascript","patch_set":15,"id":"5a5ae5dd_db05127a","line":91,"updated":"2016-02-05 21:40:20.000000000","message":"should not mix html with js. instead, create the DOM then append that. Something like:\n\n  var iframe \u003d document.createElement(\u0027iframe\u0027);\n  iframe.id \u003d keypairName;\n  iframe.src \u003d url;\n  iframe.style \u003d \"display:none\";\n\nor use Jquery to build your DOM, whatever you want.\nalso $(document.body) might be more performant.","commit_id":"693407e9370a7c2b6ca2efcdf56a90167399e012"},{"author":{"_account_id":14124,"name":"Matt Borland","email":"matt.borland@hpe.com","username":"mborland"},"change_message_id":"19777099ab11d437db06198778bcbd2884dd8358","unresolved":false,"context_lines":[{"line_number":88,"context_line":"     * @param {string} keypairName The desired name for the key pair"},{"line_number":89,"context_line":"     */"},{"line_number":90,"context_line":"    function addDOMResource(keypairName) {"},{"line_number":91,"context_line":"      var url \u003d novaAPI.getCreateKeypairUrl(keypairName);"},{"line_number":92,"context_line":"      $document.find(\u0027body\u0027).append("},{"line_number":93,"context_line":"        \"\u003ciframe id\u003d\" + keypairName + \" src\u003d\u0027\" + url +"},{"line_number":94,"context_line":"        \"\u0027 style\u003d\u0027display: none;\u0027 \u003e\u003c/iframe\u003e\""}],"source_content_type":"text/javascript","patch_set":15,"id":"5a5ae5dd_4a8aa51c","line":91,"in_reply_to":"5a5ae5dd_db05127a","updated":"2016-02-05 23:14:00.000000000","message":"I don\u0027t think we should rely on document.createElement(), and $document.createElement doesn\u0027t work in my browser. I left it the way it is now.","commit_id":"693407e9370a7c2b6ca2efcdf56a90167399e012"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"124a9f61e5e5f7e8356879574c33f6c628d857bf","unresolved":false,"context_lines":[{"line_number":92,"context_line":"      $document.find(\u0027body\u0027).append("},{"line_number":93,"context_line":"        \"\u003ciframe id\u003d\" + keypairName + \" src\u003d\u0027\" + url +"},{"line_number":94,"context_line":"        \"\u0027 style\u003d\u0027display: none;\u0027 \u003e\u003c/iframe\u003e\""},{"line_number":95,"context_line":"      );"},{"line_number":96,"context_line":"    }"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    /**"}],"source_content_type":"text/javascript","patch_set":15,"id":"5a5ae5dd_cc37964b","line":95,"updated":"2016-02-05 21:40:20.000000000","message":"Using an iframe is actually pretty standard. I don\u0027t have a problem with this approach.","commit_id":"693407e9370a7c2b6ca2efcdf56a90167399e012"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"124a9f61e5e5f7e8356879574c33f6c628d857bf","unresolved":false,"context_lines":[{"line_number":109,"context_line":"     * @param {string} name The name for the key pair"},{"line_number":110,"context_line":"     */"},{"line_number":111,"context_line":"    function verifyCreatedPromise(name) {"},{"line_number":112,"context_line":"      return $q(function doesKeypairExistPromise(resolve, reject) {"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        doesKeypairExist(10);"},{"line_number":115,"context_line":""}],"source_content_type":"text/javascript","patch_set":15,"id":"5a5ae5dd_4c6726b7","line":112,"updated":"2016-02-05 21:40:20.000000000","message":"while polling, creatAndDownloadkeypair needs to be disabled so that users can not retrigger another verifyCreatedPromise. \n\nAdditionally, in your ui patch, you should disable the create button when this is happening.","commit_id":"693407e9370a7c2b6ca2efcdf56a90167399e012"},{"author":{"_account_id":14124,"name":"Matt Borland","email":"matt.borland@hpe.com","username":"mborland"},"change_message_id":"f58e22f692967ecc0a4784624c4af931afbd087d","unresolved":false,"context_lines":[{"line_number":109,"context_line":"     * @param {string} name The name for the key pair"},{"line_number":110,"context_line":"     */"},{"line_number":111,"context_line":"    function verifyCreatedPromise(name) {"},{"line_number":112,"context_line":"      return $q(function doesKeypairExistPromise(resolve, reject) {"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        doesKeypairExist(10);"},{"line_number":115,"context_line":""}],"source_content_type":"text/javascript","patch_set":15,"id":"5a5ae5dd_07a34801","line":112,"in_reply_to":"5a5ae5dd_4c6726b7","updated":"2016-02-05 22:28:31.000000000","message":"True, but I think that\u0027s part of the UI to manage that, not this patch.  We shouldn\u0027t prevent independent retriggering here.","commit_id":"693407e9370a7c2b6ca2efcdf56a90167399e012"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"124a9f61e5e5f7e8356879574c33f6c628d857bf","unresolved":false,"context_lines":[{"line_number":126,"context_line":"              } else if (timesToCheck \u003e 1) {"},{"line_number":127,"context_line":"                doesKeypairExist(timesToCheck - 1);"},{"line_number":128,"context_line":"              } else {"},{"line_number":129,"context_line":"                reject();"},{"line_number":130,"context_line":"              }"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"            });"}],"source_content_type":"text/javascript","patch_set":15,"id":"5a5ae5dd_ac1d7a63","line":129,"updated":"2016-02-05 21:40:20.000000000","message":"Looks like you should pass something into reject as well. Currently, if this fails, the toast will display \u0027Error: Unable to generate \"\". Please try again\u0027","commit_id":"693407e9370a7c2b6ca2efcdf56a90167399e012"},{"author":{"_account_id":14124,"name":"Matt Borland","email":"matt.borland@hpe.com","username":"mborland"},"change_message_id":"19777099ab11d437db06198778bcbd2884dd8358","unresolved":false,"context_lines":[{"line_number":126,"context_line":"              } else if (timesToCheck \u003e 1) {"},{"line_number":127,"context_line":"                doesKeypairExist(timesToCheck - 1);"},{"line_number":128,"context_line":"              } else {"},{"line_number":129,"context_line":"                reject();"},{"line_number":130,"context_line":"              }"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"            });"}],"source_content_type":"text/javascript","patch_set":15,"id":"5a5ae5dd_4a914546","line":129,"in_reply_to":"5a5ae5dd_077a6877","updated":"2016-02-05 23:14:00.000000000","message":"I added code to remove the elements after the resolve/reject as you suggested in IRC.","commit_id":"693407e9370a7c2b6ca2efcdf56a90167399e012"},{"author":{"_account_id":14124,"name":"Matt Borland","email":"matt.borland@hpe.com","username":"mborland"},"change_message_id":"f58e22f692967ecc0a4784624c4af931afbd087d","unresolved":false,"context_lines":[{"line_number":126,"context_line":"              } else if (timesToCheck \u003e 1) {"},{"line_number":127,"context_line":"                doesKeypairExist(timesToCheck - 1);"},{"line_number":128,"context_line":"              } else {"},{"line_number":129,"context_line":"                reject();"},{"line_number":130,"context_line":"              }"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"            });"}],"source_content_type":"text/javascript","patch_set":15,"id":"5a5ae5dd_077a6877","line":129,"in_reply_to":"5a5ae5dd_ac1d7a63","updated":"2016-02-05 22:28:31.000000000","message":"What should we pass in this case?","commit_id":"693407e9370a7c2b6ca2efcdf56a90167399e012"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"cb124da1329cc4a9d81a97594410b42dd0c45ce4","unresolved":false,"context_lines":[{"line_number":94,"context_line":"      iframe.attr(\u0027id\u0027, keypairName);"},{"line_number":95,"context_line":"      iframe.attr(\u0027src\u0027, url);"},{"line_number":96,"context_line":"      iframe.attr(\u0027style\u0027, \u0027display: none;\u0027);"},{"line_number":97,"context_line":"      $document.find(\u0027.download-iframes\u0027).append(iframe.prop(\u0027outerHTML\u0027));"},{"line_number":98,"context_line":"    }"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    /**"}],"source_content_type":"text/javascript","patch_set":18,"id":"3a57f1b5_d9813f4f","line":97,"updated":"2016-02-09 19:25:31.000000000","message":"I think having a section where iframes go into is a great idea so you don\u0027t have to worry about id conflicts. You don\u0027t even have to id them anymore with this approach. Once you resolve or reject, can just clear out the entire thing.\n\nBut I don\u0027t think that we should require user to manually define \".download-iframes\" in their HTML. That is not self-contained. Instead, we should try to locate \".download-iframes\", and if not found, then append it to the body for temporary use.","commit_id":"1f074af1cc4653b8ec5e332b1c02cfa24aaca7dc"},{"author":{"_account_id":14124,"name":"Matt Borland","email":"matt.borland@hpe.com","username":"mborland"},"change_message_id":"aa503d8e033d07ee12a4437ce05fba2b4c666690","unresolved":false,"context_lines":[{"line_number":94,"context_line":"      iframe.attr(\u0027id\u0027, keypairName);"},{"line_number":95,"context_line":"      iframe.attr(\u0027src\u0027, url);"},{"line_number":96,"context_line":"      iframe.attr(\u0027style\u0027, \u0027display: none;\u0027);"},{"line_number":97,"context_line":"      $document.find(\u0027.download-iframes\u0027).append(iframe.prop(\u0027outerHTML\u0027));"},{"line_number":98,"context_line":"    }"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    /**"}],"source_content_type":"text/javascript","patch_set":18,"id":"3a57f1b5_0b2bfe83","line":97,"in_reply_to":"3a57f1b5_d9813f4f","updated":"2016-02-09 19:40:13.000000000","message":"Will do, sounds good.","commit_id":"1f074af1cc4653b8ec5e332b1c02cfa24aaca7dc"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"cb124da1329cc4a9d81a97594410b42dd0c45ce4","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        doesKeypairExist(10);"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"        function doesKeypairExist(timesToCheck) {"},{"line_number":119,"context_line":"          $timeout(function doesKeypairExistTimeout() {"},{"line_number":120,"context_line":"            novaAPI.getKeypairs().then(function isKeypairInResponse(response) {"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"              var foundKeypairs \u003d response.data.items.filter(function sameName(item) {"}],"source_content_type":"text/javascript","patch_set":18,"id":"3a57f1b5_995747ca","line":119,"updated":"2016-02-09 19:25:31.000000000","message":"I have a suggestion here. Instead of using timeout to rapidly fire every 1 second, can we just fire asynchronously? Fire novaAPI and wait for response, and if keypair not found and timesToCheck \u003e 1, then fire again. Continue until timesToCheck \u003d\u003d 1, then reject.","commit_id":"1f074af1cc4653b8ec5e332b1c02cfa24aaca7dc"},{"author":{"_account_id":14124,"name":"Matt Borland","email":"matt.borland@hpe.com","username":"mborland"},"change_message_id":"aa503d8e033d07ee12a4437ce05fba2b4c666690","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        doesKeypairExist(10);"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"        function doesKeypairExist(timesToCheck) {"},{"line_number":119,"context_line":"          $timeout(function doesKeypairExistTimeout() {"},{"line_number":120,"context_line":"            novaAPI.getKeypairs().then(function isKeypairInResponse(response) {"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"              var foundKeypairs \u003d response.data.items.filter(function sameName(item) {"}],"source_content_type":"text/javascript","patch_set":18,"id":"3a57f1b5_8b104e50","line":119,"in_reply_to":"3a57f1b5_995747ca","updated":"2016-02-09 19:40:13.000000000","message":"In an IRC discussion Thai agreed that this code works the way he\u0027d like.","commit_id":"1f074af1cc4653b8ec5e332b1c02cfa24aaca7dc"}],"openstack_dashboard/static/app/core/openstack-service-api/keypair-download.service.spec.js":[{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"ca08269c3596187dce3dc16346e9572a0caefb76","unresolved":false,"context_lines":[{"line_number":1,"context_line":"(function() {"},{"line_number":2,"context_line":"  \u0027use strict\u0027;"},{"line_number":3,"context_line":""},{"line_number":4,"context_line":"  describe(\u0027Download Keypair Service\u0027, function() {"}],"source_content_type":"text/javascript","patch_set":14,"id":"7a5de9d1_03561a5c","line":1,"updated":"2016-01-29 04:30:22.000000000","message":"Ditto here.","commit_id":"2866230526d966dea31282e1ca1fd053acf1f881"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"6bdf376c75b1c63d1a61ef09c84f145d67d0b459","unresolved":false,"context_lines":[{"line_number":87,"context_line":"      expect(passedObj.attr(\u0027id\u0027)).toBe(\"new/Keypair\");"},{"line_number":88,"context_line":"    });"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    it(\u0027creates a div with download-iframes if not present\u0027, function() {"},{"line_number":91,"context_line":"      spyOn(documentFindMock, \u0027append\u0027);"},{"line_number":92,"context_line":"      spyOn(documentFindMock, \u0027load\u0027).and.returnValue({});"},{"line_number":93,"context_line":"      spyOn(documentFindMock, \u0027size\u0027).and.returnValue(0);"}],"source_content_type":"text/javascript","patch_set":20,"id":"3a57f1b5_6e416039","line":90,"updated":"2016-02-09 20:09:15.000000000","message":"what about a test for destroying download-iframe on resolve or reject?","commit_id":"32906ef7db6899cd34ed2600a3a5e1c9e0280ce9"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"6bdf376c75b1c63d1a61ef09c84f145d67d0b459","unresolved":false,"context_lines":[{"line_number":122,"context_line":"      );"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"      $timeout.flush();"},{"line_number":125,"context_line":"      $scope.$apply();"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"      expect(promiseSuccessful).toEqual(true);"},{"line_number":128,"context_line":"      expect(keypair).toEqual({name: \"newKeypair\"});"}],"source_content_type":"text/javascript","patch_set":20,"id":"3a57f1b5_ce2414b1","line":125,"updated":"2016-02-09 20:09:15.000000000","message":"I don\u0027t remember - need verification here, but an apply might not be needed if flush was called since timeout triggers a digest.","commit_id":"32906ef7db6899cd34ed2600a3a5e1c9e0280ce9"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"6bdf376c75b1c63d1a61ef09c84f145d67d0b459","unresolved":false,"context_lines":[{"line_number":145,"context_line":"        }"},{"line_number":146,"context_line":"      );"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"      // checks 10 times after one second"},{"line_number":149,"context_line":"      $timeout.flush();"},{"line_number":150,"context_line":"      $timeout.flush();"},{"line_number":151,"context_line":"      $timeout.flush();"}],"source_content_type":"text/javascript","patch_set":20,"id":"3a57f1b5_8b5b6e54","line":148,"updated":"2016-02-09 20:09:15.000000000","message":"This looks repetitive.. why not just use a loop?","commit_id":"32906ef7db6899cd34ed2600a3a5e1c9e0280ce9"}],"openstack_dashboard/static/app/core/openstack-service-api/nova.service.js":[{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"aa5eeda4308b4961910f992782309796d9032b67","unresolved":false,"context_lines":[{"line_number":477,"context_line":"        encodeURIComponent(keyPairName) + \"/\";"},{"line_number":478,"context_line":"    }"},{"line_number":479,"context_line":""},{"line_number":480,"context_line":"    function constructKeyPairRegenerateUrl(keyPairName) {"},{"line_number":481,"context_line":"      return constructKeyPairDownloadUrl(keyPairName) + \"?regenerate\u003dtrue\";"},{"line_number":482,"context_line":"    }"},{"line_number":483,"context_line":""}],"source_content_type":"text/javascript","patch_set":13,"id":"9a68dd71_37fde46e","line":480,"updated":"2016-01-26 17:28:06.000000000","message":"Why use different name here than the interface name (line 57)? Just make it harder to visually map them since they are 420 lines apart.","commit_id":"747ff7311b7d6820a16c9fda6196a98f6c575a19"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"ca08269c3596187dce3dc16346e9572a0caefb76","unresolved":false,"context_lines":[{"line_number":424,"context_line":"      });"},{"line_number":425,"context_line":"    }"},{"line_number":426,"context_line":""},{"line_number":427,"context_line":"    function getCreateKeypairUrl(keyPairName) {"},{"line_number":428,"context_line":"      // NOTE: WEBROOT by definition must end with a slash (local_settings.py)."},{"line_number":429,"context_line":"      return $window.WEBROOT + \"api/nova/keypairs/\" +"},{"line_number":430,"context_line":"        encodeURIComponent(keyPairName) + \"/\";"}],"source_content_type":"text/javascript","patch_set":14,"id":"7a5de9d1_03b29a94","line":427,"updated":"2016-01-29 04:30:22.000000000","message":"This really needs some documentation.  Ditto on the function below. The oddity of this service and how it works due to the browser issues really means this need to be documented. I really like that you created a keypair-download service. It makes a lot of sense.  The functions on their own are kind of hard to decipher sitting on their own here, so providing some of that justification here and how they can be used would be helpful.  If writing that up seems hard to explain, then perhaps these should just go in the service.  I know we went back and forth on this in IRC and this is a grey area with not a great definitive answer, so use your judgment on that and consider how somebody not privvy to all the patch reviews will understand the code coming in new.","commit_id":"2866230526d966dea31282e1ca1fd053acf1f881"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"124a9f61e5e5f7e8356879574c33f6c628d857bf","unresolved":false,"context_lines":[{"line_number":440,"context_line":"     */"},{"line_number":441,"context_line":"    function getCreateKeypairUrl(keyPairName) {"},{"line_number":442,"context_line":"      // NOTE: WEBROOT by definition must end with a slash (local_settings.py)."},{"line_number":443,"context_line":"      return $window.WEBROOT + \"api/nova/keypairs/\" +"},{"line_number":444,"context_line":"        encodeURIComponent(keyPairName) + \"/\";"},{"line_number":445,"context_line":"    }"},{"line_number":446,"context_line":""}],"source_content_type":"text/javascript","patch_set":15,"id":"5a5ae5dd_511583e2","line":443,"updated":"2016-02-05 21:40:20.000000000","message":"I know that Matt had commented about WEBROOT here. Here is my take on it... If you\u0027re launching a web application, everything is assumed to be under WEBROOT with the exception of your static content, which could literally come from anywhere (for example, google\u0027s CDN).\n\nYour case is unique because you are using an iframe to trigger a request. If you are making a request to a different domain, then you would need the path full. If not, then a relative path should still be ok (look at all of our REST API if you need further confirmation).","commit_id":"693407e9370a7c2b6ca2efcdf56a90167399e012"},{"author":{"_account_id":14124,"name":"Matt Borland","email":"matt.borland@hpe.com","username":"mborland"},"change_message_id":"f58e22f692967ecc0a4784624c4af931afbd087d","unresolved":false,"context_lines":[{"line_number":440,"context_line":"     */"},{"line_number":441,"context_line":"    function getCreateKeypairUrl(keyPairName) {"},{"line_number":442,"context_line":"      // NOTE: WEBROOT by definition must end with a slash (local_settings.py)."},{"line_number":443,"context_line":"      return $window.WEBROOT + \"api/nova/keypairs/\" +"},{"line_number":444,"context_line":"        encodeURIComponent(keyPairName) + \"/\";"},{"line_number":445,"context_line":"    }"},{"line_number":446,"context_line":""}],"source_content_type":"text/javascript","patch_set":15,"id":"5a5ae5dd_a7183476","line":443,"in_reply_to":"5a5ae5dd_511583e2","updated":"2016-02-05 22:28:31.000000000","message":"WEBROOT is used for all API calls, in the API service.\n\nhttp://git.openstack.org/cgit/openstack/horizon/tree/horizon/static/framework/util/http/http.js#n32\n\nThey do not use relative paths.","commit_id":"693407e9370a7c2b6ca2efcdf56a90167399e012"}]}
