several bug fixes

This commit is contained in:
Oliver Gorwits
2013-06-09 11:30:06 +01:00
parent 9fd41f1c26
commit dfeacd12e2
9 changed files with 42 additions and 29 deletions

View File

@@ -7,7 +7,7 @@ use 5.010_000;
use File::ShareDir 'dist_dir';
use Path::Class;
our $VERSION = '2.007000_003';
our $VERSION = '2.007000_004';
BEGIN {
if (not length ($ENV{DANCER_APPDIR} || '')
@@ -28,6 +28,15 @@ BEGIN {
$ENV{DANCER_PUBLIC} ||= $auto->subdir('public')->stringify;
$ENV{DANCER_VIEWS} ||= $auto->subdir('views')->stringify;
}
{
# Dancer 1 uses the broken YAML.pm module
# This is a global sledgehammer - could just apply to Dancer::Config
use YAML;
use YAML::XS;
no warnings 'redefine';
*YAML::LoadFile = sub { goto \&YAML::XS::LoadFile };
}
}
=head1 NAME
@@ -41,10 +50,9 @@ network management tool. Pieces are still missing however, so if you're a new
user please see L<http://netdisco.org/> for further information on the project
and how to download the current official release.
L<App::Netdisco> provides a web frontend and a backend daemon to handle
interactive requests such as changing port or device properties. There is not
yet a device poller, so please still use the old Netdisco's discovery, arpnip,
and macsuck.
L<App::Netdisco> provides a web frontend with built-in web server, and a
backend daemon to handle interactive requests such as changing port or device
properties.
If you have any trouble getting the frontend running, speak to someone in the
C<#netdisco> IRC channel (on freenode). Before installing or upgrading please
@@ -131,6 +139,8 @@ take care of all this for you:
~/bin/netdisco-deploy
Answer yes to all questions, if this is a new installation of Netdisco 2.
=head1 Startup
Run the following command to start the web-app server as a backgrounded daemon
@@ -138,12 +148,17 @@ Run the following command to start the web-app server as a backgrounded daemon
~/bin/netdisco-web start
If the Inventory is empty because this is a new installation, you probably
want to either run some polling jobs from the command-line, or give a web user
some admin rights (see L</"User Rights">, below).
Run the following command to start the job control daemon (port control, etc):
~/bin/netdisco-daemon start
You should take care not to run this Netdisco daemon and the legacy daemon at
the same time.
the same time. Similarly, if you use the device discovery with Netdisco 2,
disable your system's cron jobs for the Netdisco 1 poller.
=head1 Upgrading
@@ -153,13 +168,13 @@ Notes|App::Netdisco::Manual::ReleaseNotes>. Then, the process is as follows:
# upgrade Netdisco
~/bin/localenv cpanm --notest App::Netdisco
# apply database schema updates (optionally, get latest OIDs/MIBs)
# apply database schema updates
~/bin/netdisco-deploy
# restart web service
~/bin/netdisco-web restart
# optionally, restart job daemon if you use it
# restart job daemon (if you use it)
~/bin/netdisco-daemon restart
=head1 Tips and Tricks
@@ -172,8 +187,8 @@ or MAC addreses, VLAN numbers, and so on.
=head2 User Rights
When user authentication is disabled (C<no_auth>) the default username is
"guest", which has no special privilege. To grant port and device control
When user authentication is disabled (C<no_auth: true>) the default username
is "guest", which has no special privilege. To grant port and device control
rights to this user, create a row in the C<users> table of the Netdisco
database with a username of C<guest> and appropriate flags set to true:
@@ -237,7 +252,7 @@ Oliver Gorwits <oliver@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by The Netdisco Developer Team.
This software is copyright (c) 2012, 2013 by The Netdisco Developer Team.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

View File

@@ -52,7 +52,7 @@ sub capacity_for {
my $current = $queue->search({role => $role})->count;
return ($current < setting('workers')->{$setting}));
return ($current < setting('workers')->{$setting});
}
sub take_jobs {

View File

@@ -147,7 +147,7 @@ sub _try_connect {
}
sub _build_mibdirs {
my $home = (setting('mibhome') || $ENV{NETDISCO_HOME} || $ENV{HOME});
my $home = (setting('mibhome') || dir(($ENV{NETDISCO_HOME} || $ENV{HOME}), 'netdisco-mibs'));
return map { dir($home, $_) }
@{ setting('mibdirs') || _get_mibdirs_content($home) };
}

View File

@@ -20,7 +20,8 @@ hook 'before' => sub {
->find(session('user')));
# really just for dev work, to quieten the logs
var('user')->port_control(0) if setting('no_port_control');
var('user')->port_control(0)
if var('user') and setting('no_port_control');
}
};