#49711 Ticket 49704 - Error log from the installer is concatenating all lines into one
Closed 3 years ago by spichugi. Opened 5 years ago by mreynolds.
mreynolds/389-ds-base ticket49704  into  master

@@ -116,7 +116,7 @@ 

    }

  

    if (ref_suffix == "" && (ref_attrs != "" || ref_filter != "" || ref_scope != "")) {

-     bootpopup.alert("Missing suffix - you can not set the attributes, scope, or filter without a suffix.", "Attention!");

+     popup_msg("Attention!", "Missing suffix - you can not set the attributes, scope, or filter without a suffix.");

      return;

    }

    if (ref_suffix != "" || ref_attrs != "" || ref_filter != "" || ref_scope != "") {

@@ -138,6 +138,26 @@ 

    $(".ds-modal-error").show();

  }

  

+ 

+ function popup_err(title, msg) {

+   // Display errors from the cli (we have to use pre tags)

+   bootpopup({

+     title: title,

+     content: [

+       '<pre>' + msg + '</pre>'

+     ]

+   });

+ }

+ 

+ function popup_msg(title, msg) {

+   bootpopup({

+     title: title,

+     content: [

+       '<p>' + msg + '</p>'

+     ]

+   });

+ }

+ 

  $(function() {

    $('#select-server').change(function() {

      server_id = $(this).val();
@@ -155,7 +175,4 @@ 

      });

    }

    

- 

- 

-   

  });

@@ -184,11 +184,11 @@ 

  

        if (role == "master") {

          if ($("#nsds5replicaid").val() == "" || $("#nsds5replicaid").val() === undefined ){

-           bootpopup.alert("Replica ID is required for a Master role", "Attention!");

+           popup_msg("Attention!", "Replica ID is required for a Master role");

            return;

          }

          if ( !valid_num($("#nsds5replicaid").val()) ) {

-           bootpopup.alert("Replica ID must be a number", "Attention!");

+           popup_msg("Attention!", "Replica ID must be a number");

            return;

          }

  
@@ -308,7 +308,7 @@ 

  

        // Confirm passwords match

        if (agmt_bindpw != agmt_bindpw_confirm) {

-         bootpopup.alert("Passwords do not match", "Attention!");

+         popup_msg("Attention!", "Passwords do not match");

          return;

        }

  
@@ -620,7 +620,7 @@ 

        var passwd_confirm = $("#winsync-nsds5replicacredentials-confirm").val();

  

        if (agmt_passwd != passwd_confirm) {

-         bootpopup.alert("Passwords do not match!", "Attention!");

+         popup_msg("Attention!", "Passwords do not match!");

          return;

        }

        // Get form values
@@ -721,7 +721,7 @@ 

      $("#add-repl-mgr-save").on("click", function() {

        var repl_dn = $("#add-repl-mgr-dn").val();

        if (repl_dn == ""){

-         bootpopup.alert("Replication Manager DN is required", "Attention!");

+         popup_msg("Attention!", "Replication Manager DN is required");

          return;

        }

        if ( $("#add-repl-mgr-checkbox").is(":checked") ){
@@ -729,7 +729,7 @@ 

          var agmt_bindpw = $("#add-repl-pw").val();

          var agmt_bindpw_confirm = $("#add-repl-pw-confirm").val();

          if (agmt_bindpw != agmt_bindpw_confirm) {

-           bootpopup.alert("Passwords do not match", "Attention!");

+           popup_msg("Attention!", "Passwords do not match");

            $("#add-repl-pw").val("");

            $("#add-repl-pw-confirm").val("");

            return;
@@ -738,7 +738,7 @@ 

  

        console.log("Validate dn...");

        if (!valid_dn(repl_dn)){

-         bootpopup.alert("Invalid DN for Replication Manager", "Attention!");

+         popup_msg("Attention!", "Invalid DN for Replication Manager");

          return;

        }

   

@@ -780,6 +780,7 @@ 

          report_err($("#create-inst-serverid"), 'You must provide an Instance name');

          return;

        } else {

+         new_server_id = new_server_id.replace(/^slapd-/i, "");  // strip "slapd-"

          setup_inf = setup_inf.replace('INST_NAME', new_server_id);

        }

  
@@ -858,7 +859,8 @@ 

  

        cockpit.spawn(["hostname", "--fqdn"], { superuser: true, "err": "message" }).fail(function(ex) {

          // Failed to get FQDN

-         bootpopup.alert("Failed to get hostname: " + ex.message, "Failure!");

+         popup_err("Failed to get hostname!", ex.message);

+ 

        }).done(function (data){

          // Set the hostname in inf file

          setup_inf = setup_inf.replace('FQDN', data);
@@ -866,20 +868,20 @@ 

          // Create setup inf file

          var cmd = ["/bin/sh", "-c", '/usr/bin/echo -e "' + setup_inf + '" > /tmp/389setup.inf'];

          cockpit.spawn(cmd, { superuser: true, "err": "message" }).fail(function(ex) {

-           bootpopup.alert("Failed to create installation file '/tmp/389setup.inf': " + ex.message, "Failure!");

+           popup_err("Failed to create installation file!", ex.message);

          }).done(function (){

            // Next, create the instance

            cmd = ['dscreate', 'fromfile', '/tmp/389setup.inf'];

            cockpit.spawn(cmd, { superuser: true, "err": "message" }).fail(function(ex) {

              $("#create-inst-spinner").hide();

-             bootpopup.alert("Failed to create DS instance: " + ex.message, "Failure!");

+             popup_err("Failed to create instance!", ex.message);

            }).done(function (){

              // Cleanup

              $("#create-inst-spinner").hide();

              $("#server-list-menu").attr('disabled', false); 

              $("#no-instances").hide();

              get_insts();  // Refresh server list

-             bootpopup.alert("Successfully created instance:  slapd-" + new_server_id, "Success");

+             popup_msg("Success!", "Successfully created instance:  <b>slapd-" + new_server_id + "</b>", );

              $("#create-inst-form").modal('toggle');

            });

            $("#create-inst-spinner").show();

Description: Created new bootpopup wrapper functions that use the "content" option
to add html messages. Then we use "pre" html tags for messages that
come from the CLI, and regular "p" tags for generic messages.

          Also durign instance creation we now strip "slapd-" from instance
          name because the installer automatically adds "slapd-" to the name
          anyway.

https://pagure.io/389-ds-base/issue/49704

Reviewed by: ?

rebased onto 6bfe74f

5 years ago

Pull-Request has been merged by mreynolds

5 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/2770

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

3 years ago