Lines 41-48
sub new {
Link Here
|
41 |
); |
41 |
); |
42 |
|
42 |
|
43 |
# Auto-login if credentials available |
43 |
# Auto-login if credentials available |
44 |
if ( $ENV{BUGZILLA_USER} && $ENV{BUGZILLA_PASSWORD} ) { |
44 |
my $username = $ENV{BUGZILLA_USER}; |
45 |
$client->login( $ENV{BUGZILLA_USER}, $ENV{BUGZILLA_PASSWORD} ); |
45 |
my $password = $ENV{BUGZILLA_PASSWORD}; |
|
|
46 |
|
47 |
# Try git config if env vars not set |
48 |
if ( !$username || !$password ) { |
49 |
my $tracker_section = qq{bz-tracker "$tracker"}; |
50 |
my $tracker_config = $config->{config}->{$tracker_section}; |
51 |
|
52 |
$username ||= $tracker_config->{'bz-user'} if $tracker_config; |
53 |
$password ||= $tracker_config->{'bz-password'} if $tracker_config; |
54 |
} |
55 |
|
56 |
if ( $username && $password ) { |
57 |
$client->login( $username, $password ); |
46 |
} |
58 |
} |
47 |
|
59 |
|
48 |
return bless { |
60 |
return bless { |