{"action":"created","comment":{"url":"https://api.github.com/repos/rhinstaller/anaconda/pulls/comments/71472462","id":71472462,"diff_hunk":"@@ -397,25 +418,30 @@ def execute(self, storage, ksdata, instClass):\n                                            msg=(_(\"Requested boot drive \\\"%s\\\" doesn't exist or cannot be used.\")\n                                                 % self.bootDrive)))\n         elif len(self.driveorder) >= 1:\n-            log.debug(\"Bootloader: use '%s' first disk from driveorder as boot drive\",\n-                      self.driveorder[0])\n+            log.debug(\"Bootloader: use '%s' first disk from driveorder as boot drive, dry run %s\",\n+                      self.driveorder[0], dry_run)\n             self.bootDrive = self.driveorder[0]\n         else:\n-            boot_drive = None\n             # Try to find /boot\n-            for part in ksdata.partition.partitions:\n-                if part.mountpoint == \"/boot\":\n-                    device_match = device_matches(part.disk, devicetree=storage.devicetree)\n-                    if len(device_match) == 1 and device_match[0] in disk_names:\n-                        log.debug(\"Bootloader: use /boot partition '%s' as boot drive\", device_match[0])\n-                        boot_drive = device_match[0]\n-                    break\n-            else: # Nothing was found use first disk from Blivet\n-                log.debug(\"Bootloader: fallback use first disk return from Blivet '%s' as boot drive\",\n-                          disk_names[0])\n-                boot_drive = disk_names[0]\n-\n-            self.bootDrive = boot_drive\n+            #\n+            # This method is executed two times. Before and after partitioning.\n+            # In the first run, the result is used for other partitioning but\n+            # the second will be used.\n+            try:\n+                boot_dev = storage.mountpoints[\"/boot\"]\n+                boot_drive = boot_dev.parents[0].name\n+                if boot_drive and boot_drive in disk_names:\n+                    self.bootDrive = boot_drive\n+                    log.debug(\"Bootloader: use /boot partition '%s' as boot drive, dry run %s\",\n+                              boot_drive, dry_run)\n+            except KeyError as e:\n+                log.debug(\"Bootloader: /boot partition is not present, dry run %s\", dry_run)","path":"pyanaconda/kickstart.py","position":79,"original_position":79,"commit_id":"93867606bf2be7e368509b2af048b254b4e1eb5e","original_commit_id":"93867606bf2be7e368509b2af048b254b4e1eb5e","user":{"login":"vpodzime","id":1044278,"avatar_url":"https://avatars.githubusercontent.com/u/1044278?v=3","gravatar_id":"","url":"https://api.github.com/users/vpodzime","html_url":"https://github.com/vpodzime","followers_url":"https://api.github.com/users/vpodzime/followers","following_url":"https://api.github.com/users/vpodzime/following{/other_user}","gists_url":"https://api.github.com/users/vpodzime/gists{/gist_id}","starred_url":"https://api.github.com/users/vpodzime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpodzime/subscriptions","organizations_url":"https://api.github.com/users/vpodzime/orgs","repos_url":"https://api.github.com/users/vpodzime/repos","events_url":"https://api.github.com/users/vpodzime/events{/privacy}","received_events_url":"https://api.github.com/users/vpodzime/received_events","type":"User","site_admin":false},"body":"Only the ``storage.mountpoints[\"/boot\"]`` line should be enclosed in the try-except block. The rest should go into the ``else`` branch of the block.","created_at":"2016-07-20T06:35:53Z","updated_at":"2016-07-20T06:35:53Z","html_url":"https://github.com/rhinstaller/anaconda/pull/706#discussion_r71472462","pull_request_url":"https://api.github.com/repos/rhinstaller/anaconda/pulls/706","_links":{"self":{"href":"https://api.github.com/repos/rhinstaller/anaconda/pulls/comments/71472462"},"html":{"href":"https://github.com/rhinstaller/anaconda/pull/706#discussion_r71472462"},"pull_request":{"href":"https://api.github.com/repos/rhinstaller/anaconda/pulls/706"}}},"pull_request":{"url":"https://api.github.com/repos/rhinstaller/anaconda/pulls/706","id":77996261,"html_url":"https://github.com/rhinstaller/anaconda/pull/706","diff_url":"https://github.com/rhinstaller/anaconda/pull/706.diff","patch_url":"https://github.com/rhinstaller/anaconda/pull/706.patch","issue_url":"https://api.github.com/repos/rhinstaller/anaconda/issues/706","number":706,"state":"open","locked":false,"title":"Fix bootloader when re-using existing /boot part (#1355795)","user":{"login":"jkonecny12","id":1643889,"avatar_url":"https://avatars.githubusercontent.com/u/1643889?v=3","gravatar_id":"","url":"https://api.github.com/users/jkonecny12","html_url":"https://github.com/jkonecny12","followers_url":"https://api.github.com/users/jkonecny12/followers","following_url":"https://api.github.com/users/jkonecny12/following{/other_user}","gists_url":"https://api.github.com/users/jkonecny12/gists{/gist_id}","starred_url":"https://api.github.com/users/jkonecny12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkonecny12/subscriptions","organizations_url":"https://api.github.com/users/jkonecny12/orgs","repos_url":"https://api.github.com/users/jkonecny12/repos","events_url":"https://api.github.com/users/jkonecny12/events{/privacy}","received_events_url":"https://api.github.com/users/jkonecny12/received_events","type":"User","site_admin":false},"body":"When existing partition was used then a bootloader saved this partition to other variable which wasn't tested.\r\n\r\nDo a more robust fallback and also try to find disk from devicetree instead of KS command. Sorry I had to create ugly hack with ``dry_run`` to achieve this.\r\n\r\n*Related: rhbz#1355795*","created_at":"2016-07-19T15:21:48Z","updated_at":"2016-07-20T06:35:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"face2e98d8357fdccfe623709924ab08a3be69d8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rhinstaller/anaconda/pulls/706/commits","review_comments_url":"https://api.github.com/repos/rhinstaller/anaconda/pulls/706/comments","review_comment_url":"https://api.github.com/repos/rhinstaller/anaconda/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rhinstaller/anaconda/issues/706/comments","statuses_url":"https://api.github.com/repos/rhinstaller/anaconda/statuses/93867606bf2be7e368509b2af048b254b4e1eb5e","head":{"label":"jkonecny12:rhel7-branch-fix-bootloader-boot-part","ref":"rhel7-branch-fix-bootloader-boot-part","sha":"93867606bf2be7e368509b2af048b254b4e1eb5e","user":{"login":"jkonecny12","id":1643889,"avatar_url":"https://avatars.githubusercontent.com/u/1643889?v=3","gravatar_id":"","url":"https://api.github.com/users/jkonecny12","html_url":"https://github.com/jkonecny12","followers_url":"https://api.github.com/users/jkonecny12/followers","following_url":"https://api.github.com/users/jkonecny12/following{/other_user}","gists_url":"https://api.github.com/users/jkonecny12/gists{/gist_id}","starred_url":"https://api.github.com/users/jkonecny12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkonecny12/subscriptions","organizations_url":"https://api.github.com/users/jkonecny12/orgs","repos_url":"https://api.github.com/users/jkonecny12/repos","events_url":"https://api.github.com/users/jkonecny12/events{/privacy}","received_events_url":"https://api.github.com/users/jkonecny12/received_events","type":"User","site_admin":false},"repo":{"id":32858900,"name":"anaconda","full_name":"jkonecny12/anaconda","owner":{"login":"jkonecny12","id":1643889,"avatar_url":"https://avatars.githubusercontent.com/u/1643889?v=3","gravatar_id":"","url":"https://api.github.com/users/jkonecny12","html_url":"https://github.com/jkonecny12","followers_url":"https://api.github.com/users/jkonecny12/followers","following_url":"https://api.github.com/users/jkonecny12/following{/other_user}","gists_url":"https://api.github.com/users/jkonecny12/gists{/gist_id}","starred_url":"https://api.github.com/users/jkonecny12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkonecny12/subscriptions","organizations_url":"https://api.github.com/users/jkonecny12/orgs","repos_url":"https://api.github.com/users/jkonecny12/repos","events_url":"https://api.github.com/users/jkonecny12/events{/privacy}","received_events_url":"https://api.github.com/users/jkonecny12/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jkonecny12/anaconda","description":"Graphical system installer","fork":true,"url":"https://api.github.com/repos/jkonecny12/anaconda","forks_url":"https://api.github.com/repos/jkonecny12/anaconda/forks","keys_url":"https://api.github.com/repos/jkonecny12/anaconda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jkonecny12/anaconda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jkonecny12/anaconda/teams","hooks_url":"https://api.github.com/repos/jkonecny12/anaconda/hooks","issue_events_url":"https://api.github.com/repos/jkonecny12/anaconda/issues/events{/number}","events_url":"https://api.github.com/repos/jkonecny12/anaconda/events","assignees_url":"https://api.github.com/repos/jkonecny12/anaconda/assignees{/user}","branches_url":"https://api.github.com/repos/jkonecny12/anaconda/branches{/branch}","tags_url":"https://api.github.com/repos/jkonecny12/anaconda/tags","blobs_url":"https://api.github.com/repos/jkonecny12/anaconda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jkonecny12/anaconda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jkonecny12/anaconda/git/refs{/sha}","trees_url":"https://api.github.com/repos/jkonecny12/anaconda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jkonecny12/anaconda/statuses/{sha}","languages_url":"https://api.github.com/repos/jkonecny12/anaconda/languages","stargazers_url":"https://api.github.com/repos/jkonecny12/anaconda/stargazers","contributors_url":"https://api.github.com/repos/jkonecny12/anaconda/contributors","subscribers_url":"https://api.github.com/repos/jkonecny12/anaconda/subscribers","subscription_url":"https://api.github.com/repos/jkonecny12/anaconda/subscription","commits_url":"https://api.github.com/repos/jkonecny12/anaconda/commits{/sha}","git_commits_url":"https://api.github.com/repos/jkonecny12/anaconda/git/commits{/sha}","comments_url":"https://api.github.com/repos/jkonecny12/anaconda/comments{/number}","issue_comment_url":"https://api.github.com/repos/jkonecny12/anaconda/issues/comments{/number}","contents_url":"https://api.github.com/repos/jkonecny12/anaconda/contents/{+path}","compare_url":"https://api.github.com/repos/jkonecny12/anaconda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jkonecny12/anaconda/merges","archive_url":"https://api.github.com/repos/jkonecny12/anaconda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jkonecny12/anaconda/downloads","issues_url":"https://api.github.com/repos/jkonecny12/anaconda/issues{/number}","pulls_url":"https://api.github.com/repos/jkonecny12/anaconda/pulls{/number}","milestones_url":"https://api.github.com/repos/jkonecny12/anaconda/milestones{/number}","notifications_url":"https://api.github.com/repos/jkonecny12/anaconda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jkonecny12/anaconda/labels{/name}","releases_url":"https://api.github.com/repos/jkonecny12/anaconda/releases{/id}","deployments_url":"https://api.github.com/repos/jkonecny12/anaconda/deployments","created_at":"2015-03-25T10:54:16Z","updated_at":"2015-05-06T12:43:59Z","pushed_at":"2016-07-19T15:21:15Z","git_url":"git://github.com/jkonecny12/anaconda.git","ssh_url":"git@github.com:jkonecny12/anaconda.git","clone_url":"https://github.com/jkonecny12/anaconda.git","svn_url":"https://github.com/jkonecny12/anaconda","homepage":null,"size":133959,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rhinstaller:rhel7-branch","ref":"rhel7-branch","sha":"f04f3a2b58588e2fb5984546a0f9fa98fe8516f8","user":{"login":"rhinstaller","id":10549274,"avatar_url":"https://avatars.githubusercontent.com/u/10549274?v=3","gravatar_id":"","url":"https://api.github.com/users/rhinstaller","html_url":"https://github.com/rhinstaller","followers_url":"https://api.github.com/users/rhinstaller/followers","following_url":"https://api.github.com/users/rhinstaller/following{/other_user}","gists_url":"https://api.github.com/users/rhinstaller/gists{/gist_id}","starred_url":"https://api.github.com/users/rhinstaller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhinstaller/subscriptions","organizations_url":"https://api.github.com/users/rhinstaller/orgs","repos_url":"https://api.github.com/users/rhinstaller/repos","events_url":"https://api.github.com/users/rhinstaller/events{/privacy}","received_events_url":"https://api.github.com/users/rhinstaller/received_events","type":"Organization","site_admin":false},"repo":{"id":30210846,"name":"anaconda","full_name":"rhinstaller/anaconda","owner":{"login":"rhinstaller","id":10549274,"avatar_url":"https://avatars.githubusercontent.com/u/10549274?v=3","gravatar_id":"","url":"https://api.github.com/users/rhinstaller","html_url":"https://github.com/rhinstaller","followers_url":"https://api.github.com/users/rhinstaller/followers","following_url":"https://api.github.com/users/rhinstaller/following{/other_user}","gists_url":"https://api.github.com/users/rhinstaller/gists{/gist_id}","starred_url":"https://api.github.com/users/rhinstaller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhinstaller/subscriptions","organizations_url":"https://api.github.com/users/rhinstaller/orgs","repos_url":"https://api.github.com/users/rhinstaller/repos","events_url":"https://api.github.com/users/rhinstaller/events{/privacy}","received_events_url":"https://api.github.com/users/rhinstaller/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rhinstaller/anaconda","description":"Graphical system installer","fork":false,"url":"https://api.github.com/repos/rhinstaller/anaconda","forks_url":"https://api.github.com/repos/rhinstaller/anaconda/forks","keys_url":"https://api.github.com/repos/rhinstaller/anaconda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rhinstaller/anaconda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rhinstaller/anaconda/teams","hooks_url":"https://api.github.com/repos/rhinstaller/anaconda/hooks","issue_events_url":"https://api.github.com/repos/rhinstaller/anaconda/issues/events{/number}","events_url":"https://api.github.com/repos/rhinstaller/anaconda/events","assignees_url":"https://api.github.com/repos/rhinstaller/anaconda/assignees{/user}","branches_url":"https://api.github.com/repos/rhinstaller/anaconda/branches{/branch}","tags_url":"https://api.github.com/repos/rhinstaller/anaconda/tags","blobs_url":"https://api.github.com/repos/rhinstaller/anaconda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rhinstaller/anaconda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rhinstaller/anaconda/git/refs{/sha}","trees_url":"https://api.github.com/repos/rhinstaller/anaconda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rhinstaller/anaconda/statuses/{sha}","languages_url":"https://api.github.com/repos/rhinstaller/anaconda/languages","stargazers_url":"https://api.github.com/repos/rhinstaller/anaconda/stargazers","contributors_url":"https://api.github.com/repos/rhinstaller/anaconda/contributors","subscribers_url":"https://api.github.com/repos/rhinstaller/anaconda/subscribers","subscription_url":"https://api.github.com/repos/rhinstaller/anaconda/subscription","commits_url":"https://api.github.com/repos/rhinstaller/anaconda/commits{/sha}","git_commits_url":"https://api.github.com/repos/rhinstaller/anaconda/git/commits{/sha}","comments_url":"https://api.github.com/repos/rhinstaller/anaconda/comments{/number}","issue_comment_url":"https://api.github.com/repos/rhinstaller/anaconda/issues/comments{/number}","contents_url":"https://api.github.com/repos/rhinstaller/anaconda/contents/{+path}","compare_url":"https://api.github.com/repos/rhinstaller/anaconda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rhinstaller/anaconda/merges","archive_url":"https://api.github.com/repos/rhinstaller/anaconda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rhinstaller/anaconda/downloads","issues_url":"https://api.github.com/repos/rhinstaller/anaconda/issues{/number}","pulls_url":"https://api.github.com/repos/rhinstaller/anaconda/pulls{/number}","milestones_url":"https://api.github.com/repos/rhinstaller/anaconda/milestones{/number}","notifications_url":"https://api.github.com/repos/rhinstaller/anaconda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rhinstaller/anaconda/labels{/name}","releases_url":"https://api.github.com/repos/rhinstaller/anaconda/releases{/id}","deployments_url":"https://api.github.com/repos/rhinstaller/anaconda/deployments","created_at":"2015-02-02T21:56:45Z","updated_at":"2016-07-03T05:23:44Z","pushed_at":"2016-07-20T01:28:51Z","git_url":"git://github.com/rhinstaller/anaconda.git","ssh_url":"git@github.com:rhinstaller/anaconda.git","clone_url":"https://github.com/rhinstaller/anaconda.git","svn_url":"https://github.com/rhinstaller/anaconda","homepage":null,"size":192755,"stargazers_count":58,"watchers_count":58,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":74,"mirror_url":null,"open_issues_count":27,"forks":74,"open_issues":27,"watchers":58,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rhinstaller/anaconda/pulls/706"},"html":{"href":"https://github.com/rhinstaller/anaconda/pull/706"},"issue":{"href":"https://api.github.com/repos/rhinstaller/anaconda/issues/706"},"comments":{"href":"https://api.github.com/repos/rhinstaller/anaconda/issues/706/comments"},"review_comments":{"href":"https://api.github.com/repos/rhinstaller/anaconda/pulls/706/comments"},"review_comment":{"href":"https://api.github.com/repos/rhinstaller/anaconda/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rhinstaller/anaconda/pulls/706/commits"},"statuses":{"href":"https://api.github.com/repos/rhinstaller/anaconda/statuses/93867606bf2be7e368509b2af048b254b4e1eb5e"}}}}
{"actor":{"display_login":"vpodzime"}}