{"action":"created","comment":{"url":"https://api.github.com/repos/SUSE/yast2-rmt/pulls/comments/171190683","pull_request_review_id":99998497,"id":171190683,"diff_hunk":"@@ -0,0 +1,88 @@\n+# Copyright (c) 2018 SUSE LLC.\n+#  All Rights Reserved.\n+\n+#  This program is free software; you can redistribute it and/or\n+#  modify it under the terms of version 2 or 3 of the GNU General\n+#  Public License as published by the Free Software Foundation.\n+\n+#  This program is distributed in the hope that it will be useful,\n+#  but WITHOUT ANY WARRANTY; without even the implied warranty of\n+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.   See the\n+#  GNU General Public License for more details.\n+\n+#  You should have received a copy of the GNU General Public License\n+#  along with this program; if not, contact SUSE LLC.\n+\n+#  To contact SUSE about this file by physical or electronic mail,\n+#  you may find current contact information at www.suse.com\n+\n+require 'rmt/base'\n+\n+module RMT; end\n+module RMT::MariaDB; end\n+\n+class RMT::MariaDB::CurrentRootPasswordDialog < RMT::Base\n+  def run\n+    ret = nil\n+\n+    UI.OpenDialog(\n+      VBox(\n+        VSpacing(1),\n+        Heading(_('Database root password is required')),\n+        VSpacing(1),\n+        HBox(\n+          HSpacing(2),\n+          VBox(\n+            Label(_('Please provide the current database root password.')),\n+            MinWidth(15, Password(Id(:root_password), _('MariaDB root &password')))\n+          ),\n+          HSpacing(2)\n+        ),\n+        VSpacing(1),\n+        HBox(\n+          PushButton(Id(:cancel), Opt(:key_F9), Label.CancelButton),\n+          HSpacing(2),\n+          PushButton(Id(:ok), Opt(:default, :key_F10), Label.OKButton)\n+        ),\n+        VSpacing(1)\n+      )\n+    )\n+\n+    UI.SetFocus(Id(:root_password))\n+\n+    loop do\n+      user_ret = UI.UserInput\n+\n+      if user_ret == :cancel\n+        ret = nil\n+        break\n+      elsif user_ret == :ok\n+        root_password = UI.QueryWidget(Id(:root_password), :Value)\n+\n+        if !root_password || root_password.empty?\n+          UI.SetFocus(Id(:root_password))\n+          Report.Error(_('Please provide the root password.'))\n+          next\n+        elsif !root_password_valid?(root_password)\n+          UI.SetFocus(Id(:root_password))\n+          Report.Error(_('The provided password is not valid.'))\n+          next\n+        end\n+\n+        ret = root_password\n+        break\n+      end\n+    end\n+\n+    UI.CloseDialog\n+\n+    ret\n+  end\n+\n+  def root_password_valid?(password)\n+    run_command(\n+      \"echo 'show databases;' | mysql -u root -p%1 2>/dev/null\",\n+      password","path":"src/lib/rmt/maria_db/current_root_password_dialog.rb","position":85,"original_position":85,"commit_id":"51ab31055378be8e83ebbdba8652fa78b3e1e4e0","original_commit_id":"51ab31055378be8e83ebbdba8652fa78b3e1e4e0","user":{"login":"ikapelyukhin","id":1793699,"avatar_url":"https://avatars1.githubusercontent.com/u/1793699?v=4","gravatar_id":"","url":"https://api.github.com/users/ikapelyukhin","html_url":"https://github.com/ikapelyukhin","followers_url":"https://api.github.com/users/ikapelyukhin/followers","following_url":"https://api.github.com/users/ikapelyukhin/following{/other_user}","gists_url":"https://api.github.com/users/ikapelyukhin/gists{/gist_id}","starred_url":"https://api.github.com/users/ikapelyukhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikapelyukhin/subscriptions","organizations_url":"https://api.github.com/users/ikapelyukhin/orgs","repos_url":"https://api.github.com/users/ikapelyukhin/repos","events_url":"https://api.github.com/users/ikapelyukhin/events{/privacy}","received_events_url":"https://api.github.com/users/ikapelyukhin/received_events","type":"User","site_admin":false},"body":"@jreidinger does it really log the commands though? I've checked my `~/.y2log` and it seems the commands aren't logged there with the default log level.","created_at":"2018-02-28T09:51:38Z","updated_at":"2018-02-28T09:51:38Z","html_url":"https://github.com/SUSE/yast2-rmt/pull/1#discussion_r171190683","pull_request_url":"https://api.github.com/repos/SUSE/yast2-rmt/pulls/1","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/SUSE/yast2-rmt/pulls/comments/171190683"},"html":{"href":"https://github.com/SUSE/yast2-rmt/pull/1#discussion_r171190683"},"pull_request":{"href":"https://api.github.com/repos/SUSE/yast2-rmt/pulls/1"}},"in_reply_to_id":170873079},"pull_request":{"url":"https://api.github.com/repos/SUSE/yast2-rmt/pulls/1","id":169154939,"html_url":"https://github.com/SUSE/yast2-rmt/pull/1","diff_url":"https://github.com/SUSE/yast2-rmt/pull/1.diff","patch_url":"https://github.com/SUSE/yast2-rmt/pull/1.patch","issue_url":"https://api.github.com/repos/SUSE/yast2-rmt/issues/1","number":1,"state":"closed","locked":false,"title":"RMT wizard","user":{"login":"ikapelyukhin","id":1793699,"avatar_url":"https://avatars1.githubusercontent.com/u/1793699?v=4","gravatar_id":"","url":"https://api.github.com/users/ikapelyukhin","html_url":"https://github.com/ikapelyukhin","followers_url":"https://api.github.com/users/ikapelyukhin/followers","following_url":"https://api.github.com/users/ikapelyukhin/following{/other_user}","gists_url":"https://api.github.com/users/ikapelyukhin/gists{/gist_id}","starred_url":"https://api.github.com/users/ikapelyukhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikapelyukhin/subscriptions","organizations_url":"https://api.github.com/users/ikapelyukhin/orgs","repos_url":"https://api.github.com/users/ikapelyukhin/repos","events_url":"https://api.github.com/users/ikapelyukhin/events{/privacy}","received_events_url":"https://api.github.com/users/ikapelyukhin/received_events","type":"User","site_admin":false},"body":"ATM, has 2 wizard screens for SCC mirroring credentials and the DB.","created_at":"2018-02-14T16:18:22Z","updated_at":"2018-02-28T09:51:38Z","closed_at":"2018-02-26T16:06:15Z","merged_at":"2018-02-26T16:06:15Z","merge_commit_sha":"55c4c1d811ba9ac525de18d2cb6f4015e9d76d47","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/SUSE/yast2-rmt/pulls/1/commits","review_comments_url":"https://api.github.com/repos/SUSE/yast2-rmt/pulls/1/comments","review_comment_url":"https://api.github.com/repos/SUSE/yast2-rmt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SUSE/yast2-rmt/issues/1/comments","statuses_url":"https://api.github.com/repos/SUSE/yast2-rmt/statuses/51ab31055378be8e83ebbdba8652fa78b3e1e4e0","head":{"label":"SUSE:rmt_wizard","ref":"rmt_wizard","sha":"51ab31055378be8e83ebbdba8652fa78b3e1e4e0","user":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars0.githubusercontent.com/u/1067733?v=4","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":119535402,"name":"yast2-rmt","full_name":"SUSE/yast2-rmt","owner":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars0.githubusercontent.com/u/1067733?v=4","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SUSE/yast2-rmt","description":null,"fork":false,"url":"https://api.github.com/repos/SUSE/yast2-rmt","forks_url":"https://api.github.com/repos/SUSE/yast2-rmt/forks","keys_url":"https://api.github.com/repos/SUSE/yast2-rmt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SUSE/yast2-rmt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SUSE/yast2-rmt/teams","hooks_url":"https://api.github.com/repos/SUSE/yast2-rmt/hooks","issue_events_url":"https://api.github.com/repos/SUSE/yast2-rmt/issues/events{/number}","events_url":"https://api.github.com/repos/SUSE/yast2-rmt/events","assignees_url":"https://api.github.com/repos/SUSE/yast2-rmt/assignees{/user}","branches_url":"https://api.github.com/repos/SUSE/yast2-rmt/branches{/branch}","tags_url":"https://api.github.com/repos/SUSE/yast2-rmt/tags","blobs_url":"https://api.github.com/repos/SUSE/yast2-rmt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SUSE/yast2-rmt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SUSE/yast2-rmt/git/refs{/sha}","trees_url":"https://api.github.com/repos/SUSE/yast2-rmt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SUSE/yast2-rmt/statuses/{sha}","languages_url":"https://api.github.com/repos/SUSE/yast2-rmt/languages","stargazers_url":"https://api.github.com/repos/SUSE/yast2-rmt/stargazers","contributors_url":"https://api.github.com/repos/SUSE/yast2-rmt/contributors","subscribers_url":"https://api.github.com/repos/SUSE/yast2-rmt/subscribers","subscription_url":"https://api.github.com/repos/SUSE/yast2-rmt/subscription","commits_url":"https://api.github.com/repos/SUSE/yast2-rmt/commits{/sha}","git_commits_url":"https://api.github.com/repos/SUSE/yast2-rmt/git/commits{/sha}","comments_url":"https://api.github.com/repos/SUSE/yast2-rmt/comments{/number}","issue_comment_url":"https://api.github.com/repos/SUSE/yast2-rmt/issues/comments{/number}","contents_url":"https://api.github.com/repos/SUSE/yast2-rmt/contents/{+path}","compare_url":"https://api.github.com/repos/SUSE/yast2-rmt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SUSE/yast2-rmt/merges","archive_url":"https://api.github.com/repos/SUSE/yast2-rmt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SUSE/yast2-rmt/downloads","issues_url":"https://api.github.com/repos/SUSE/yast2-rmt/issues{/number}","pulls_url":"https://api.github.com/repos/SUSE/yast2-rmt/pulls{/number}","milestones_url":"https://api.github.com/repos/SUSE/yast2-rmt/milestones{/number}","notifications_url":"https://api.github.com/repos/SUSE/yast2-rmt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SUSE/yast2-rmt/labels{/name}","releases_url":"https://api.github.com/repos/SUSE/yast2-rmt/releases{/id}","deployments_url":"https://api.github.com/repos/SUSE/yast2-rmt/deployments","created_at":"2018-01-30T12:51:22Z","updated_at":"2018-02-13T11:01:25Z","pushed_at":"2018-02-28T09:32:51Z","git_url":"git://github.com/SUSE/yast2-rmt.git","ssh_url":"git@github.com:SUSE/yast2-rmt.git","clone_url":"https://github.com/SUSE/yast2-rmt.git","svn_url":"https://github.com/SUSE/yast2-rmt","homepage":null,"size":83,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"SUSE:master","ref":"master","sha":"b2c3b99730c25076d67194332497636e2ff2f303","user":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars0.githubusercontent.com/u/1067733?v=4","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":119535402,"name":"yast2-rmt","full_name":"SUSE/yast2-rmt","owner":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars0.githubusercontent.com/u/1067733?v=4","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SUSE/yast2-rmt","description":null,"fork":false,"url":"https://api.github.com/repos/SUSE/yast2-rmt","forks_url":"https://api.github.com/repos/SUSE/yast2-rmt/forks","keys_url":"https://api.github.com/repos/SUSE/yast2-rmt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SUSE/yast2-rmt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SUSE/yast2-rmt/teams","hooks_url":"https://api.github.com/repos/SUSE/yast2-rmt/hooks","issue_events_url":"https://api.github.com/repos/SUSE/yast2-rmt/issues/events{/number}","events_url":"https://api.github.com/repos/SUSE/yast2-rmt/events","assignees_url":"https://api.github.com/repos/SUSE/yast2-rmt/assignees{/user}","branches_url":"https://api.github.com/repos/SUSE/yast2-rmt/branches{/branch}","tags_url":"https://api.github.com/repos/SUSE/yast2-rmt/tags","blobs_url":"https://api.github.com/repos/SUSE/yast2-rmt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SUSE/yast2-rmt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SUSE/yast2-rmt/git/refs{/sha}","trees_url":"https://api.github.com/repos/SUSE/yast2-rmt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SUSE/yast2-rmt/statuses/{sha}","languages_url":"https://api.github.com/repos/SUSE/yast2-rmt/languages","stargazers_url":"https://api.github.com/repos/SUSE/yast2-rmt/stargazers","contributors_url":"https://api.github.com/repos/SUSE/yast2-rmt/contributors","subscribers_url":"https://api.github.com/repos/SUSE/yast2-rmt/subscribers","subscription_url":"https://api.github.com/repos/SUSE/yast2-rmt/subscription","commits_url":"https://api.github.com/repos/SUSE/yast2-rmt/commits{/sha}","git_commits_url":"https://api.github.com/repos/SUSE/yast2-rmt/git/commits{/sha}","comments_url":"https://api.github.com/repos/SUSE/yast2-rmt/comments{/number}","issue_comment_url":"https://api.github.com/repos/SUSE/yast2-rmt/issues/comments{/number}","contents_url":"https://api.github.com/repos/SUSE/yast2-rmt/contents/{+path}","compare_url":"https://api.github.com/repos/SUSE/yast2-rmt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SUSE/yast2-rmt/merges","archive_url":"https://api.github.com/repos/SUSE/yast2-rmt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SUSE/yast2-rmt/downloads","issues_url":"https://api.github.com/repos/SUSE/yast2-rmt/issues{/number}","pulls_url":"https://api.github.com/repos/SUSE/yast2-rmt/pulls{/number}","milestones_url":"https://api.github.com/repos/SUSE/yast2-rmt/milestones{/number}","notifications_url":"https://api.github.com/repos/SUSE/yast2-rmt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SUSE/yast2-rmt/labels{/name}","releases_url":"https://api.github.com/repos/SUSE/yast2-rmt/releases{/id}","deployments_url":"https://api.github.com/repos/SUSE/yast2-rmt/deployments","created_at":"2018-01-30T12:51:22Z","updated_at":"2018-02-13T11:01:25Z","pushed_at":"2018-02-28T09:32:51Z","git_url":"git://github.com/SUSE/yast2-rmt.git","ssh_url":"git@github.com:SUSE/yast2-rmt.git","clone_url":"https://github.com/SUSE/yast2-rmt.git","svn_url":"https://github.com/SUSE/yast2-rmt","homepage":null,"size":83,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SUSE/yast2-rmt/pulls/1"},"html":{"href":"https://github.com/SUSE/yast2-rmt/pull/1"},"issue":{"href":"https://api.github.com/repos/SUSE/yast2-rmt/issues/1"},"comments":{"href":"https://api.github.com/repos/SUSE/yast2-rmt/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/SUSE/yast2-rmt/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/SUSE/yast2-rmt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SUSE/yast2-rmt/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/SUSE/yast2-rmt/statuses/51ab31055378be8e83ebbdba8652fa78b3e1e4e0"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ikapelyukhin"}}