Skip to content

Commit

Permalink
Make separate import config files optional
Browse files Browse the repository at this point in the history
For regular import jobs, RT admins may wish to keep these settings
alongside the rest of their RT config instead of managing separate
config files.
  • Loading branch information
Jason Crome committed May 14, 2024
1 parent 94a20bb commit e5b6432
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
7 changes: 1 addition & 6 deletions bin/rt-extension-import-csv.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ if ( $opt{help} || !$file ) {
exit;
}

unless ( $opt{config} ) {
Pod::Usage::pod2usage( "Option config is required" );
exit;
}

unless ( ( $opt{type} // '' ) =~ /^(?:user|ticket|transaction|article)$/ ) {
Pod::Usage::pod2usage( "Invalid type provided, should be one of user/ticket/transaction/article" );
exit;
Expand Down Expand Up @@ -213,7 +208,7 @@ delimted files. See L<RT::Extension::Import::CSV> for configuration.
Provides an explicit extra configuration file which is loaded before any
other configuration files. This is useful to provide per-import settings.
F<RT_SiteConfig.pm> should B<not> contain settings for options with hashes
that may get merged with per-import settings. This option is required.
that may get merged with per-import settings.
=item C<--type> I<user|ticket|transaction|article> or C<-t> I<user|ticket|transaction|article>
Expand Down
9 changes: 5 additions & 4 deletions lib/RT/Extension/Import/CSV.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1636,10 +1636,11 @@ in the callback. It expects no return value.
=head1 RUNNING THE IMPORT WITH A NON-DEFAULT CONFIGURATION
You must explicitly pass a configuration file to the importer. Use the
C<--config> option to specify the path and filename to the
configuration file to use; C<--type> indicates the type of import to
run (article, ticket, transation, or article):
You can explicitly pass a configuration file to the importer. This is
often used in conjunction when specifying an import type other than
ticket. Use the C<--config> option to specify the path and filename
to the configuration file to use; C<--type> indicates the type of
import to run (article, ticket, transation, or article):
rt-extension-csv-importer --config /path/to/config.pm --type user /path/to/user-data.csv
rt-extension-csv-importer --config /path/to/config.pm --type ticket /path/to/ticket-data.csv
Expand Down

0 comments on commit e5b6432

Please sign in to comment.