[Rt-commit] rt branch, 4.4/ldapimporter-debug-backcompat, created. rt-4.4.1-225-g8fecf12
Alex Vandiver
alexmv at bestpractical.com
Thu Jan 5 02:32:26 EST 2017
The branch, 4.4/ldapimporter-debug-backcompat has been created
at 8fecf127c414310f88dd81dfcc69317b5ab4ae8f (commit)
- Log -----------------------------------------------------------------
commit ac755a40430963fa282a4dd464a50bdbed1fca1e
Author: Alex Vandiver <alex at chmrr.net>
Date: Wed Jan 4 22:40:23 2017 -0800
Allow --debug as a synonym for --verbose, for back-compatibility
75899f244 removed --debug as an option to rt-ldapimport, replacing it
with --verbose. While --debug had had no effect since it was core'd
in 4.4.0, existing configurations may still contain an invocation with
--debug in their crontabs -- removing it will cause those imports to
begin failing. Such a change mid-stable-series would be unfortunate.
Allow 'debug', when passed to RT::Interface::CLI's Init, to serve the
same purpose as --verbose. This allows backwards compatibiity to be
preserved.
diff --git a/lib/RT/Interface/CLI.pm b/lib/RT/Interface/CLI.pm
index 8f7f977..bb1ed6b 100644
--- a/lib/RT/Interface/CLI.pm
+++ b/lib/RT/Interface/CLI.pm
@@ -154,6 +154,9 @@ user sees all relevant warnings. It also adds C<--quiet> and
C<--verbose> options, which adjust the C<LogToSTDERR> value to C<error>
or C<debug>, respectively.
+If C<debug> is provided as a parameter, it added as an alias for
+C<--verbose>.
+
=cut
sub Init {
@@ -186,6 +189,9 @@ sub Init {
push @args, "verbose|v!" => \($hash->{verbose})
unless $exists{verbose};
+ push @args, "debug!" => \($hash->{verbose})
+ if $exists{debug};
+
push @args, "quiet|q!" => \($hash->{quiet})
unless $exists{quiet};
diff --git a/sbin/rt-ldapimport.in b/sbin/rt-ldapimport.in
index dc90d17..3086d93 100644
--- a/sbin/rt-ldapimport.in
+++ b/sbin/rt-ldapimport.in
@@ -83,7 +83,7 @@ my %OPT = (
use RT::Interface::CLI qw(Init);
Init(
\%OPT,
- 'help',
+ 'debug', 'help',
'import', 'users!', 'groups!');
if ($OPT{help}) {
print <<USAGE;
commit 82e1a4b08154facdcdf91081a07028274ff3afef
Author: Alex Vandiver <alex at chmrr.net>
Date: Wed Jan 4 22:41:02 2017 -0800
Remove an unnecessary $|++ -- Init() does so
diff --git a/sbin/rt-ldapimport.in b/sbin/rt-ldapimport.in
index 3086d93..93db252 100644
--- a/sbin/rt-ldapimport.in
+++ b/sbin/rt-ldapimport.in
@@ -49,8 +49,6 @@
use strict;
use warnings;
-$|++;
-
# fix lib paths, some may be relative
BEGIN { # BEGIN RT CMD BOILERPLATE
require File::Spec;
commit 9dcd1a04f72230e802d13e5ee9279dbac08af65e
Author: Alex Vandiver <alex at chmrr.net>
Date: Wed Jan 4 22:41:35 2017 -0800
Swap out a hardcoded inline help for automatic POD::Usage help
diff --git a/sbin/rt-ldapimport.in b/sbin/rt-ldapimport.in
index 93db252..a86b2c5 100644
--- a/sbin/rt-ldapimport.in
+++ b/sbin/rt-ldapimport.in
@@ -81,19 +81,9 @@ my %OPT = (
use RT::Interface::CLI qw(Init);
Init(
\%OPT,
- 'debug', 'help',
- 'import', 'users!', 'groups!');
-if ($OPT{help}) {
- print <<USAGE;
-$0: [--import] [--help]
- --help This usage statement.
- --verbose Show additional logging.
- --import Do the import.
- --no-users Skip users.
- --no-groups Skip groups.
-USAGE
- exit 0;
-}
+ 'debug',
+ 'import',
+ 'users!', 'groups!');
my $importer = RT::LDAPImport->new;
@@ -120,3 +110,41 @@ TESTING
}
print "Finished test\n";
}
+
+__END__
+
+=head1 NAME
+
+rt-ldapimport - Import users and groups from external sources
+
+=head1 SYNOPSIS
+
+ rt-ldapimport [--import]
+
+=head1 DESCRIPTION
+
+See L<RT::LDAPImport> for configuration instructions.
+
+=head1 OPTIONS
+
+=over
+
+=item C<--import>
+
+Without this flag, merely does a dry-run of the import.
+
+=item C<--verbose>
+
+Log more data when importing.
+
+=item C<--no-users>
+
+Skip user import.
+
+=item C<--no-groups>
+
+Skip group import.
+
+=back
+
+=cut
commit 948d76dfd9398d5c98576357e8114c3ae4216728
Author: Alex Vandiver <alex at chmrr.net>
Date: Wed Jan 4 23:28:26 2017 -0800
Fix a typo
diff --git a/lib/RT/LDAPImport.pm b/lib/RT/LDAPImport.pm
index f43bb95..e2aaa81 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 \
- --verbuse > ldapimport.debug 2>&1
+ --verbose > ldapimport.debug 2>&1
# Run for real, possibly put in cron
/opt/rt4/sbin/rt-ldapimport \
commit 88a165ac089feff6bcf210978c51bf8cd2856087
Author: Alex Vandiver <alex at chmrr.net>
Date: Wed Jan 4 23:28:49 2017 -0800
The informtation is "debug information" -- "verbose information" sounds odd
diff --git a/lib/RT/LDAPImport.pm b/lib/RT/LDAPImport.pm
index e2aaa81..ccb51c8 100644
--- a/lib/RT/LDAPImport.pm
+++ b/lib/RT/LDAPImport.pm
@@ -350,7 +350,7 @@ 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<--verbose> flag.
-That verbose information is also sent to the RT log with the debug level.
+That debug 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
commit 8fecf127c414310f88dd81dfcc69317b5ab4ae8f
Author: Alex Vandiver <alex at chmrr.net>
Date: Wed Jan 4 23:29:38 2017 -0800
Unwrap the example lines, for better readability
diff --git a/lib/RT/LDAPImport.pm b/lib/RT/LDAPImport.pm
index ccb51c8..bd731db 100644
--- a/lib/RT/LDAPImport.pm
+++ b/lib/RT/LDAPImport.pm
@@ -89,12 +89,10 @@ In C<RT_SiteConfig.pm>:
Running the import:
# Run a test import
- /opt/rt4/sbin/rt-ldapimport \
- --verbose > ldapimport.debug 2>&1
+ /opt/rt4/sbin/rt-ldapimport --verbose > ldapimport.debug 2>&1
# Run for real, possibly put in cron
- /opt/rt4/sbin/rt-ldapimport \
- --import
+ /opt/rt4/sbin/rt-ldapimport --import
=head1 CONFIGURATION
-----------------------------------------------------------------------
More information about the rt-commit
mailing list