[Rt-commit] rt branch, 4.4-trunk, updated. rt-4.4.1-217-g4d15505

Shawn Moore shawn at bestpractical.com
Wed Jan 4 17:23:48 EST 2017


The branch, 4.4-trunk has been updated
       via  4d15505851a8a1184cd5364804a28b0508a2661d (commit)
       via  75899f244b4736d0dd30770c9cf2d2c753fba6d7 (commit)
      from  552ebebdcd96396b8cb0b9a10d1f54ac9c7b10e0 (commit)

Summary of changes:
 lib/RT/LDAPImport.pm  |  6 +++---
 sbin/rt-ldapimport.in | 26 +++++++-------------------
 2 files changed, 10 insertions(+), 22 deletions(-)

- Log -----------------------------------------------------------------
commit 75899f244b4736d0dd30770c9cf2d2c753fba6d7
Author: Dustin Collins <strega at bestpractical.com>
Date:   Sat Dec 31 19:41:51 2016 -0500

    Fix rt-ldapimporter logging output
    
    --debug is replaced with --verbose because the logging level
    changes were being set too late.
    This is related to 9d354baa1a434c619248605d860676e48b17737d
    
    Fixes: I#32196

diff --git a/lib/RT/LDAPImport.pm b/lib/RT/LDAPImport.pm
index 10cd0a7..4604f2b 100644
--- a/lib/RT/LDAPImport.pm
+++ b/lib/RT/LDAPImport.pm
@@ -90,7 +90,7 @@ Running the import:
 
     # Run a test import
     /opt/rt4/sbin/rt-ldapimport \
-    --debug > ldapimport.debug 2>&1
+    --verbuse > ldapimport.debug 2>&1
     
     # Run for real, possibly put in cron
     /opt/rt4/sbin/rt-ldapimport \
@@ -348,9 +348,9 @@ members) should exist unless there are inconsistencies in your LDAP configuratio
 
 Executing C<rt-ldapimport> will run a test that connects to your LDAP server
 and prints out a list of the users found. To see more about these users,
-and to see more general debug information, include the C<--debug> flag.
+and to see more general debug information, include the C<--verbose> flag.
 
-That debug information is also sent to the RT log with the debug level.
+That verbose information is also sent to the RT log with the debug level.
 Errors are logged to the screen and to the RT log.
 
 Executing C<rt-ldapimport> with the C<--import> flag will cause it to import
diff --git a/sbin/rt-ldapimport.in b/sbin/rt-ldapimport.in
index 449e7f0..2ba28d0 100644
--- a/sbin/rt-ldapimport.in
+++ b/sbin/rt-ldapimport.in
@@ -68,11 +68,6 @@ BEGIN { # BEGIN RT CMD BOILERPLATE
 
 }
 
-BEGIN {
-    use RT;
-    RT::LoadConfig();
-    RT::Init();
-};
 
 eval { require RT::LDAPImport; 1; } or do {
     print "Unable to run rt-ldapimport without dependencies.\n";
@@ -85,17 +80,16 @@ my %OPT = (
     users  => 1,
     groups => 1,
 );
-use Getopt::Long;
-GetOptions(
+use RT::Interface::CLI qw(Init);
+Init(
     \%OPT,
-    'debug', 'help',
-    'import', 'users!', 'groups!',
-);
+    'help',
+    'import', 'users!', 'groups!');
 if ($OPT{help}) {
    print <<USAGE;
-$0: [--debug] [--import] [--help]
+$0: [--import] [--help]
      --help           This usage statement.
-     --debug          Enable debugging.
+     --verbose        Show additional logging.
      --import         Do the import.
      --no-users       Skip users.
      --no-groups      Skip groups.
@@ -105,12 +99,6 @@ USAGE
 
 my $importer = RT::LDAPImport->new;
 
-if( $OPT{debug} ) {
-    RT->Config->Set( LogToSTDERR => 'debug' );
-} else {
-    RT->Config->Set( LogToSTDERR => undef );
-}
-
 if ($OPT{import}) {
     if ($OPT{users}) {
         print "Starting import\n";
@@ -125,7 +113,7 @@ if ($OPT{import}) {
     print <<TESTING;
 Running test import, no data will be changed
 Rerun command with --import to perform the import
-Rerun command with --debug for more information
+Rerun command with --verbose for more information
 TESTING
     $importer->import_users if $OPT{users};
     if ($OPT{groups}) {

commit 4d15505851a8a1184cd5364804a28b0508a2661d
Merge: 552ebeb 75899f2
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed Jan 4 22:21:52 2017 +0000

    Merge branch '4.4/fix-ldapimporter-debug-logging' into 4.4-trunk


-----------------------------------------------------------------------


More information about the rt-commit mailing list