2 Replies Latest reply: May 31, 2012 12:24 AM by 940747 RSS

    oc12c "custom_files" JET profile setting broken

    929491
      Problem 1: Defining more than 1 custom file to be deloyed in the deployment plan for JET variables, breaks the deployment.

      I had “custom_files” defined as “root-profile:o:/.profile root-kshrc:o:/.kshrc”

      The resulting “host.config” file for the host “vhc02aup02” had the following settings. Which in turn breaks OSP.
      # grep custom_files vhc02aup02/host.config
      # custom_files="hosts:a:/etc/hosts"
      custom_files="OpsCenterAgent.Solaris.sparc.12.1.0.2001.zip:o:/var/tmp/OpsCenterAgent.Solaris.sparc.12.1.0.2001.zip virtualController.properties:o:/var/tmp/virtualController.properties truststore:o:/var/tmp/truststore root-profile:o:/.profile root-kshrc root-profile:o:/.profile root-kshrc"
      custom_files_1=""
      custom_files_m=""
      custom_files_n=""

      Problem 2: Defining “custom_files_1” JET profile setting also doesn’t get written to the “host.config” file either. As 3 line entries for “custom_files” gets written. Notice above the “grep” displays the “custom_files_1” value, but below it gets over written.

      # grep custom_files vhc02aup01/host.config
      # custom_files="hosts:a:/etc/hosts"
      custom_files="OpsCenterAgent.Solaris.sparc.12.1.0.2001.zip:o:/var/tmp/OpsCenterAgent.Solaris.sparc.12.1.0.2001.zip virtualController.properties:o:/var/tmp/virtualController.properties truststore:o:/var/tmp/truststore"
      custom_files="OpsCenterAgent.Solaris.sparc.12.1.0.2001.zip:o:/var/tmp/OpsCenterAgent.Solaris.sparc.12.1.0.2001.zip virtualController.properties:o:/var/tmp/virtualController.properties truststore:o:/var/tmp/truststore"
      custom_files="OpsCenterAgent.Solaris.sparc.12.1.0.2001.zip:o:/var/tmp/OpsCenterAgent.Solaris.sparc.12.1.0.2001.zip virtualController.properties:o:/var/tmp/virtualController.properties truststore:o:/var/tmp/truststore"
      custom_files="OpsCenterAgent.Solaris.sparc.12.1.0.2001.zip:o:/var/tmp/OpsCenterAgent.Solaris.sparc.12.1.0.2001.zip virtualController.properties:o:/var/tmp/virtualController.properties truststore:o:/var/tmp/truststore"
        • 1. Re: oc12c "custom_files" JET profile setting broken
          929491
          Found the 11g V 12c perl module code for the “custom_files” re-write. I possibly could make the change, but I'm sure the backend guys would love to fix it from the backend.

          The issue is with the “ProfileProxy.pm” file "/opt/SUNWscnosp/lib/perl5/ProfileProxy.pm"

          *11g Profile.Proxy.pm snippet*
          # cat /opt/SUNWscnosp/lib/perl5/ProfileProxy.pm
          if (!defined ($jet_data_hash{custom_files})) {
          $replace_string = $replace_string ." -e "."'s/^custom_files..*/custom_files=\"" . "truststore" . "\:o\:" .$self->escape_string("/var/tmp/truststore") . "\"/'";
          } else {
          # Concat customer custom_files with ours
          my $cust_files = $jet_data_hash{custom_files};
          $cust_files =~ tr/"//d;
          $replace_string = $replace_string ." -e "."'s/^custom_files=..*/custom_files=\"" . "truststore" . "\:o\:" . $self->escape_string("/var/tmp/truststore") . " " . $self->escape_string($cust_files) . "\"/'";
          }


          *12c Profile.Proxy.pm snippet*
          # cat /opt/SUNWscnosp/lib/perl5/ProfileProxy.pm
          if (defined ($jet_data_hash{custom_files})) {
          my $cust_files = $jet_data_hash{custom_files};
          if ($cust_files ne "" || $cust_files ne -1) {
          $cust_files = handle_custom_files($cust_files, $jet_dir, $hostname);
          $cust_files =~ tr/"//d;
          # Concat customer custom_files with ours
          $replace_string = $replace_string ." -e "."'s/^custom_files=..*/custom_files=\"" . "truststore" . "\:o\:" . $self->escape_string("/var/tmp/truststore") . " " . $self->escape_string($cust_files) . "\"/'";
          }
          } else {
          $replace_string = $replace_string ." -e "."'s/^custom_files..*/custom_files=\"" . "truststore" . "\:o\:" .$self->escape_string("/var/tmp/truststore") . "\"/'";
          }


          sub handle_custom_files()
          {
          my $cust_files = shift @_ ;
          my $jet_dir = shift @_ ;
          my $hostname = shift @_ ;
          my $new_cust_files = "";
          if ($cust_files ne "" || $cust_files ne -1) {
          # First copy all custom files to client directory
          # custom_files format source_file:action:destination
          # There could be multiple entries with space in between

          my @entries = split(/\s+/, $cust_files);
          foreach my $entry (@entries){
          my $entry = $cust_files;
          my @fields = split(/:/, $entry);
          my $source = $fields[0];
          if ($source ne "" || $source ne -1) {
          print "/bin/cp $source $jet_dir/Clients/ $hostname/";
          system("/bin/cp $source ". "$jet_dir/Clients/". $hostname."/");
          # reconstruct the custom_files entry
          $source = File::Basename::basename($source);
          $new_cust_files = $new_cust_files." ".$source.":".$fields[1].":".$fields[2];
          }
          }
          }
          return $new_cust_files;
          }
          • 2. Re: oc12c "custom_files" JET profile setting broken
            940747
            I've Noticed that this is now fixed and that the files have been updated