Module: Yast::SupportDialogsInclude
- Defined in:
- ../../src/include/support/dialogs.rb
Instance Method Summary (collapse)
-
- (Object) ContactDialog
Configure2 dialog.
-
- (Object) ExpertDialog
Overview dialog.
- - (Object) FilesDialog
- - (Object) GenerateDialog
- - (Object) initialize_support_dialogs(include_target)
- - (Object) OverviewDialog
-
- (Object) ParametersDialog
Command line parameters dialog.
- - (Object) UploadDialog(data_prepared)
Instance Method Details
- (Object) ContactDialog
Configure2 dialog
675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 |
# File '../../src/include/support/dialogs.rb', line 675 def ContactDialog # Support configure2 dialog caption caption = _("Supportconfig Contact Configuration") # Support configure2 dialog contents contents = VBox( Frame( _("Contact Information"), VBox( Left( InputField( Id(:company), _("Company"), Ops.get_string( Support., "VAR_OPTION_CONTACT_COMPANY", "" ) ) ), Left( InputField( Id(:email), _("Email Address"), Ops.get_string(Support., "VAR_OPTION_CONTACT_EMAIL", "") ) ), Left( InputField( Id(:name), _("Name"), Ops.get_string(Support., "VAR_OPTION_CONTACT_NAME", "") ) ), Left( InputField( Id(:phone), _("Phone Number"), Ops.get_string(Support., "VAR_OPTION_CONTACT_PHONE", "") ) ), Left( InputField( Id(:storeid), _("Store ID"), Ops.get_string( Support., "VAR_OPTION_CONTACT_STOREID", "" ) ) ), Left( InputField( Id(:terminalid), _("Terminal ID"), Ops.get_string( Support., "VAR_OPTION_CONTACT_TERMINALID", "" ) ) ), Left( InputField( Id(:gpg_uid), _("GPG UID"), Ops.get_string(Support., "VAR_OPTION_GPG_UID", "") ) ) ) ), Frame( _("Upload Information"), VBox( Left( InputField( Id(:target), _("Upload Target"), Builtins.deletechars( Ops.get_string( Support., "VAR_OPTION_UPLOAD_TARGET", "" ), "'" ) ) ), Left( InputField( Id(:novell_number), _("Novell 11-digit service request number"), Support.novell_number ) ) ) ) ) Wizard.SetContentsButtons( caption, contents, Ops.get_string(@HELPS, "contact", ""), Label.BackButton, Label.NextButton ) UI.ChangeWidget(:novell_number, :ValidChars, "0123456789") ret = nil while true ret = UI.UserInput # abort? if ret == :abort || ret == :cancel if ReallyAbort() break else next end elsif ret == :next || ret == :back Ops.set( Support., "VAR_OPTION_CONTACT_COMPANY", Convert.to_string(UI.QueryWidget(:company, :Value)) ) Ops.set( Support., "VAR_OPTION_CONTACT_EMAIL", Convert.to_string(UI.QueryWidget(:email, :Value)) ) Ops.set( Support., "VAR_OPTION_CONTACT_NAME", Convert.to_string(UI.QueryWidget(:name, :Value)) ) Ops.set( Support., "VAR_OPTION_CONTACT_PHONE", Convert.to_string(UI.QueryWidget(:phone, :Value)) ) Ops.set( Support., "VAR_OPTION_CONTACT_STOREID", Convert.to_string(UI.QueryWidget(:storeid, :Value)) ) Ops.set( Support., "VAR_OPTION_CONTACT_TERMINALID", Convert.to_string(UI.QueryWidget(:terminalid, :Value)) ) Ops.set( Support., "VAR_OPTION_UPLOAD_TARGET", Builtins.sformat( "'%1'", Convert.to_string(UI.QueryWidget(:target, :Value)) ) ) Ops.set( Support., "VAR_OPTION_GPG_UID", Convert.to_string(UI.QueryWidget(:gpg_uid, :Value)) ) Support.novell_number = Convert.to_string( UI.QueryWidget(:novell_number, :Value) ) if Ops.greater_than(Builtins.size(Support.novell_number), 0) if Builtins.size(Support.novell_number) != 11 Popup.Error(_("The SR number must be 11 digits")) ret = nil next end end Support.WriteConfig break else Builtins.y2error("unexpected retcode: %1", ret) next end end deep_copy(ret) end |
- (Object) ExpertDialog
Overview dialog
579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 |
# File '../../src/include/support/dialogs.rb', line 579 def ExpertDialog # Support overview dialog caption caption = _("Supportconfig Expert Configuration") overview = Support.Overview bool_items = [] # list<term> table_items = []; Builtins.foreach( Convert.convert( Map.Keys(Support.), :from => "list", :to => "list <string>" ) ) do |key| if !Builtins.issubstring(key, "VAR_OPTION") value = Ops.get_string(@support_descr, key, "") bool_items = Builtins.add( bool_items, Item( Id(key), Ops.greater_than(Builtins.size(value), 0) ? Builtins.sformat("%1 - %2", key, value) : key, Ops.get_string(Support., key, "") == "1" ) ) end end # FIXME table header contents = HBox( MultiSelectionBox(Id(:opt_msb), _("Default Options"), bool_items) #, ) Wizard.SetContentsButtons( caption, contents, Ops.get_string(@HELPS, "expert_params", ""), Label.BackButton, Label.NextButton ) ret = nil while true ret = UI.UserInput # abort? if ret == :abort || ret == :cancel if ReallyAbort() break else next end elsif ret == :next Builtins.y2milestone( "store configuration for /etc/supportconfig.conf" ) selected_items = Convert.to_list( UI.QueryWidget(Id(:opt_msb), :SelectedItems) ) Builtins.foreach( Convert.convert( Map.Keys(Support.), :from => "list", :to => "list <string>" ) ) do |key| val = Ops.get_string(Support., key, "") if !Builtins.issubstring(key, "VAR_OPTION") bool_val = Builtins.contains(selected_items, key) if (val == "1") != bool_val Builtins.y2milestone( "value changed %1=%2, new value %3", key, val, bool_val ? "1" : "0" ) Ops.set(Support., key, bool_val ? "1" : "0") end end end break elsif ret == :back break else Builtins.y2error("unexpected retcode: %1", ret) next end end Builtins.y2milestone("%1", Support.) Convert.to_symbol(ret) end |
- (Object) FilesDialog
927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 |
# File '../../src/include/support/dialogs.rb', line 927 def FilesDialog caption = _("Collected Data Review") # FIXME use list of generated files, as well as directory prefix output = Convert.to_map( SCR.Execute( path(".target.bash_output"), Builtins.sformat( "ls -t %1|grep nts|head -n1|tr -d '\n'", Ops.get_string(Support.log_files, "tmp_dir", "") ) ) ) Builtins.y2milestone("output %1", output) if Ops.get_integer(output, "exit", -1) != 0 Popup.Error(Ops.get_string(output, "stderr", "")) return :back end Ops.set( Support.log_files, "log_dir", Ops.get_string(output, "stdout", "") ) full_log_path = Builtins.sformat( "%1/%2/", Ops.get_string(Support.log_files, "tmp_dir", ""), Ops.get_string(Support.log_files, "log_dir", "") ) output = Convert.to_map( SCR.Execute( path(".target.bash_output"), Builtins.sformat("ls %1", full_log_path) ) ) if Ops.get_integer(output, "exit", -1) != 0 Popup.Error(Ops.get_string(output, "stderr", "")) return :back end files = Builtins.filter( Builtins.splitstring(Ops.get_string(output, "stdout", ""), "\n") ) { |s| Ops.greater_than(Builtins.size(s), 0) } contents = VBox( HBox( HStretch(), ReplacePoint( Id(:filelist_rp), ComboBox( Id(:filelist), Opt(:notify, :hstretch), _("File Name"), files ) ), VBox( Label(""), PushButton(Id(:remove), Opt(:hstretch), _("Remove from Data")) ), HStretch() ), ReplacePoint( Id(:file_rp), # `MultiLineEdit (`id (`file), `opt (`read_only), _("File Contents")) RichText(Id(:file), Opt(:plainText), "") ) ) Wizard.SetContentsButtons( caption, contents, Ops.get_string(@HELPS, "review", ""), Label.BackButton, Label.NextButton ) ret = :filelist while true if ret == :filelist file = Ops.add( full_log_path, Convert.to_string(UI.QueryWidget(Id(:filelist), :Value)) ) data = Convert.to_string(SCR.Read(path(".target.string"), file)) UI.ReplaceWidget( Id(:file_rp), RichText(Id(:file), Opt(:plainText), data) ) end ret = Convert.to_symbol(UI.UserInput) if ret == :next break end break if ret == :abort || ret == :back if ret == :remove file = Convert.to_string(UI.QueryWidget(Id(:filelist), :Value)) files = Builtins.filter(files) { |f| f != file } UI.ReplaceWidget( Id(:filelist_rp), ComboBox( Id(:filelist), Opt(:notify, :hstretch), _("File Name"), files ) ) ret = :filelist # FIXME uncomment, following line not tested Builtins.y2milestone("removing %1%2", full_log_path, file) SCR.Execute( path(".target.bash"), Builtins.sformat("/bin/rm %1%2", full_log_path, file) ) end end ret end |
- (Object) GenerateDialog
861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 |
# File '../../src/include/support/dialogs.rb', line 861 def GenerateDialog caption = _("Collecting Data") contents = VBox(LogView(Id(:log), _("Progress"), 1000, 1000)) Wizard.SetContentsButtons( caption, contents, Ops.get_string(@HELPS, "collecting", ""), Label.BackButton, Label.NextButton ) uuid_param = Builtins.issubstring( Ops.get_string(Support., "VAR_OPTION_UPLOAD_TARGET", ""), "novell.com" ) ? "-q" : "" cmd = Builtins.sformat( "supportconfig %1 %2 -t %3", Support.GetParameterList, uuid_param, Ops.get_string(Support.log_files, "tmp_dir", "") ) if Support.WhoAmI != 0 return :back if !Support.AskForRootPwd id = Support.WhoAmI SCR.Write( path(".target.string"), Support.pwd_file, Ops.add(Support.root_pw, "\n") ) cmd = Builtins.sformat( "cat %4 | su -c '%1 && chown -R %3 %2'", cmd, Ops.get_string(Support.log_files, "tmp_dir", ""), id, Support.pwd_file ) end ret = nil pid = Convert.to_integer(SCR.Execute(path(".process.start_shell"), cmd)) unfinished_line = "" Wizard.DisableNextButton while true Builtins.sleep(100) if SCR.Read(path(".process.running"), pid) == true new_text = Convert.to_string(SCR.Read(path(".process.read"), pid)) UI.ChangeWidget(Id(:log), :LastLine, new_text) if new_text != nil else Wizard.EnableNextButton break end ret = Convert.to_symbol(UI.PollInput) if ret == :back || ret == :abort SCR.Execute(path(".process.kill"), pid) break end end if Support.WhoAmI != 0 SCR.Write(path(".target.string"), Support.pwd_file, "") end while ret != :back && ret != :abort && ret != :next ret = Convert.to_symbol(UI.UserInput) end ret end |
- (Object) initialize_support_dialogs(include_target)
32 33 34 35 36 37 38 39 40 41 42 |
# File '../../src/include/support/dialogs.rb', line 32 def initialize_support_dialogs(include_target) textdomain "support" Yast.import "Label" Yast.import "Report" Yast.import "Wizard" Yast.import "Support" Yast.import "Map" Yast.include include_target, "support/helps.rb" Yast.include include_target, "support/supportconfig_conf.rb" end |
- (Object) OverviewDialog
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
# File '../../src/include/support/dialogs.rb', line 44 def OverviewDialog # Command line parameters dialog caption caption = _("Supportconfig Overview Dialog") # Support configure1 dialog contents contents = HBox( HStretch(), VBox( Frame( _("Open Novell Support Center"), VBox( HStretch(), Left( Label( _( "This will start a browser connecting to the Novell Support Center Portal." ) ) ), HBox( HStretch(), HStretch(), HStretch(), HStretch(), MinWidth(25, PushButton(Id(:browser), _("Open"))), HStretch(), HStretch(), HStretch(), HStretch() ) ) ), VSpacing(2), Frame( Opt(:hstretch), _("Collect Data"), VBox( HStretch(), Left( Label( _( "This will create a tarball containing the collected log files." ) ) ), HBox( HStretch(), HStretch(), HStretch(), HStretch(), MinWidth( 25, PushButton(Id(:tarball), _("Create report tarball")) ), HStretch(), HStretch(), HStretch(), HStretch() ) ) ), VSpacing(2), Frame( Opt(:hstretch), _("Upload Data"), VBox( HStretch(), Label( _("This will upload the collected logs to the specified URL.") ), HBox( HStretch(), HStretch(), HStretch(), HStretch(), MinWidth(25, PushButton(Id(:upload), _("Upload"))), HStretch(), HStretch(), HStretch(), HStretch() ) ) ) ), HStretch() ) Wizard.SetContentsButtons( caption, contents, Ops.get_string(@HELPS, "overview", ""), Label.BackButton, Label.FinishButton ) Wizard.DisableBackButton ret = nil while true ret = UI.UserInput if ret == :abort || ret == :cancel || ret == :tarball || ret == :upload || ret == :next break elsif ret == :browser if Support.browser == nil Popup.Error(_("Could not find any installed browser.")) else url = "'http://www.novell.com/center/eservice'" if 0 == SCR.Execute( path(".target.bash"), "env|grep LOGNAME|cut -d'=' -f2- | grep root" ) if Popup.ContinueCancel( Builtins.sformat( _( "YaST will run a Web browser as superuser. Consider\n" + "running it as a non-provileged user and entering the URL\n" + "%1.\n" + "Start Web browser?\n" ), url ) ) Builtins.y2milestone( "Executing browser %1 with URL %2", Support.browser, url ) SCR.Execute( path(".target.bash"), Builtins.sformat("%1 %2", Support.browser, url) ) end else Builtins.y2milestone( "Executing browser %1 with URL %2", Support.browser, url ) SCR.Execute( path(".target.bash"), Builtins.sformat( "su $(env|grep LOGNAME|cut -d'=' -f2-) -c \"%1 %2\"", Support.browser, url ) ) end end end end ret = :abort if ret == :cancel deep_copy(ret) end |
- (Object) ParametersDialog
Command line parameters dialog
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 |
# File '../../src/include/support/dialogs.rb', line 416 def ParametersDialog # Command line parameters dialog caption caption = _("Supportconfig Parameters Configuration") items = [ Item( Id(:full_listening), _("Create a full file listing from '/'"), Support.full_listening ), Item( Id(:exclude_disk_scan), _("Exclude detailed disk info and scans"), Support.exclude_disk_scan ), Item( Id(:search_for_edir), _("Search root filesystem for eDirectory instances"), Support.search_for_edir ), Item( Id(:include_slp), _("Include full SLP service lists"), Support.include_slp ), Item( Id(:rpm_check), _("Performs an rpm -V for each installed rpm"), Support.rpm_check ), Item( Id(:additional_logs), _("Include all log file lines, gather additional rotated logs"), Support.additional_logs ) ] # Support configure1 dialog contents contents = VBox( Left( RadioButtonGroup( Id(:rb), VBox( Left( RadioButton( Id(:use_defaults), Opt(:notify), _("Use Defaults (ignore /etc/supportconfig.conf)") ) ), Left( RadioButton( Id(:full_logging), Opt(:notify), _("Activates all support functions") ) ), Left( RadioButton( Id(:minimal_logs), Opt(:notify), _("Only gather a minimum amount of info") ) ), Left( VBox( RadioButton( Id(:custom), Opt(:notify), _("Use Custom (Expert) Settings") ), PushButton(Id(:expert), _("Expert Settings")) ) ) ) ) ), MultiSelectionBox(Id(:options), _("Options"), items) ) Wizard.SetContentsButtons( caption, contents, Ops.get_string(@HELPS, "support_params", ""), Label.BackButton, Label.NextButton ) if Support.use_defaults UI.ChangeWidget(:rb, :CurrentButton, :use_defaults) elsif Support.full_logging UI.ChangeWidget(:rb, :CurrentButton, :full_logging) elsif Support.minimal_logs UI.ChangeWidget(:rb, :CurrentButton, :minimal_logs) else UI.ChangeWidget(:rb, :CurrentButton, :custom) end # Wizard::DisableBackButton(); ret = nil while true UI.ChangeWidget( :expert, :Enabled, UI.QueryWidget(:rb, :CurrentButton) == :custom ) ret = UI.UserInput if ret == :use_defaults || ret == :full_logging || ret == :minimal_logs || ret == :custom next end # abort? if ret == :abort || ret == :cancel if ReallyAbort() break else next end elsif ret == :back break elsif ret == :next || ret == :expert selected = Convert.to_list(UI.QueryWidget(:options, :SelectedItems)) Support.use_defaults = Builtins.contains(selected, :use_defaults) Support.full_listening = Builtins.contains(selected, :full_listening) Support.exclude_disk_scan = Builtins.contains( selected, :exclude_disk_scan ) Support.search_for_edir = Builtins.contains( selected, :search_for_edir ) Support.full_logging = Builtins.contains(selected, :full_logging) Support.minimal_logs = Builtins.contains(selected, :minimal_logs) Support.include_slp = Builtins.contains(selected, :include_slp) Support.rpm_check = Builtins.contains(selected, :rpm_check) Support.additional_logs = Builtins.contains(selected, :additional_logs) case Convert.to_symbol(UI.QueryWidget(:rb, :CurrentButton)) when :use_defaults Support.use_defaults = true when :full_logging Support.full_logging = true when :minimal_logs Support.minimal_logs = true else Builtins.y2milestone("Custom settings") end break else Builtins.y2error("unexpected retcode: %1", ret) next end end deep_copy(ret) end |
- (Object) UploadDialog(data_prepared)
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 |
# File '../../src/include/support/dialogs.rb', line 200 def UploadDialog(data_prepared) caption = _("Supportconfig Upload Dialog") url = Builtins.deletechars( Ops.get_string(Support., "VAR_OPTION_UPLOAD_TARGET", ""), "'" ) Builtins.y2milestone("URL value from /etc/supportconfig.conf : %1", url) Builtins.y2milestone("%1", Support.log_files) home = Ops.get_string( Convert.convert( SCR.Execute(path(".target.bash_output"), "echo ~|tr -d '\n'"), :from => "any", :to => "map <string, any>" ), "stdout", "" ) # Support configure1 dialog contents load_save = nil if data_prepared load_save = Left( CheckBoxFrame( Id(:save), _("Save as"), true, HBox( InputField(Id(:save_dir), _("Directory to Save"), home), VBox(Label(""), PushButton(Id(:browse), Label.BrowseButton)) ) ) ) else load_save = Left( HBox( InputField( Id(:tarball_file), _("Package with log files"), Ops.get_string(Support.log_files, "tarball", "") ), VBox(Label(""), PushButton(Id(:browse), Label.BrowseButton)) ) ) end contents = Frame( "", VBox( load_save, CheckBoxFrame( Id(:upload), _("Upload log files tarball to URL"), true, Left(InputField(Id(:url), _("Upload Target"), url)) ) ) ) help = data_prepared ? Ops.get_string(@HELPS, "upload_save", "") : Ops.get_string(@HELPS, "upload_select", "") Wizard.SetContentsButtons( caption, contents, help, Label.BackButton, Label.NextButton ) ret = nil while true ret = UI.UserInput break if ret == :abort || ret == :back if ret == :next if !data_prepared unpack = Builtins.sformat( "cd %1 && tar xvf %2", Ops.get_string(Support.log_files, "tmp_dir", ""), Ops.get_string(Support.log_files, "tarball", "") ) Builtins.y2milestone( "unpack %1", SCR.Execute(path(".target.bash_output"), unpack) ) # break; end Builtins.y2milestone("data_prepared %1", data_prepared) Builtins.y2milestone("Support::log_files %1", Support.log_files) command = Builtins.sformat( "supportconfig %1 -f %2", Support.GetParameterList, Ops.get_string(Support.log_files, "tmp_dir", "") ) if Convert.to_boolean(UI.QueryWidget(:upload, :Value)) url2 = Convert.to_string(UI.QueryWidget(:url, :Value)) if Ops.greater_than(Builtins.size(url2), 0) #{ command = Builtins.sformat("%1 -u -U '%2'", command, url2) end # } end if Support.WhoAmI != 0 return :back if !Support.AskForRootPwd id = Support.WhoAmI SCR.Write( path(".target.string"), Support.pwd_file, Ops.add(Support.root_pw, "\n") ) command = Builtins.sformat( "cat %2 | su -c '%1'", command, Support.pwd_file ) end Builtins.y2milestone("executing %1", command) output = Convert.convert( SCR.Execute(path(".target.bash_output"), command), :from => "any", :to => "map <string, any>" ) Builtins.y2milestone("output %1", output) if Support.WhoAmI != 0 SCR.Write(path(".target.string"), Support.pwd_file, "") end if Ops.get_integer(output, "exit", -1) != 0 Report.Error( Builtins.sformat("%1 : %2", _("Cannot write settings"), output) ) else command = Builtins.sformat( "find \"%1\" -type f -name \"%2*\"|grep -v \".md5$\" | tr -d '\n'", Ops.get_string(Support.log_files, "tmp_dir", ""), Ops.get_string(Support.log_files, "log_dir", "") ) Builtins.y2milestone("command %1", command) output = Convert.convert( SCR.Execute(path(".target.bash_output"), command), :from => "any", :to => "map <string, any>" ) if Ops.get_integer(output, "exit", -1) != 0 Report.Error( Builtins.sformat("%1 : %2", _("Cannot write settings."), output) ) else if Ops.greater_than( Builtins.size(Ops.get_string(output, "stdout", "")), 0 ) Ops.set( Support.log_files, "tarball", Ops.get_string(output, "stdout", "") ) Builtins.y2milestone( "input tarball : %1", Ops.get_string(Support.log_files, "tarball", "") ) if data_prepared && Convert.to_boolean(UI.QueryWidget(:save, :Value)) tarball = Ops.get_string(Support.log_files, "tarball", "") output_dir = Convert.to_string( UI.QueryWidget(:save_dir, :Value) ) command2 = Builtins.sformat( "cp %1* '%2'", tarball, output_dir ) Builtins.y2milestone( "execute %1 : %2", command2, SCR.Execute(path(".target.bash_output"), command2) ) end else Builtins.y2error("Empty filename : %1", output) end end end break end if ret == :browse if data_prepared startdir = Convert.to_string(UI.QueryWidget(:save_dir, :Value)) Builtins.y2milestone("startdir %1", startdir) save_dir = UI.AskForExistingDirectory( startdir, _("Choose Directory Where to Save Tarball") ) if save_dir != nil && Ops.greater_than(Builtins.size(save_dir), 0) UI.ChangeWidget(:save_dir, :Value, save_dir) # Support::log_files["tmp_dir"]=save_dir; else Builtins.y2error("Empty or invalid logs tarball path") end else tarball_file = UI.AskForExistingFile( "/", "*.tgz *.tbz", _("Choose Log Files Tarball File") ) if tarball_file != nil && Ops.greater_than(Builtins.size(tarball_file), 0) UI.ChangeWidget(:tarball_file, :Value, tarball_file) Ops.set(Support.log_files, "tarball", tarball_file) else Builtins.y2error("Empty or invalid logs tarball path") end end next end end deep_copy(ret) end |