support action::namespace for netdisco-do
This commit is contained in:
@@ -14,6 +14,7 @@ foreach my $slot (qw/
|
||||
device
|
||||
port
|
||||
action
|
||||
only_namespace
|
||||
subaction
|
||||
status
|
||||
username
|
||||
@@ -36,6 +37,15 @@ has '_statuslist' => (
|
||||
default => sub { [] },
|
||||
);
|
||||
|
||||
sub BUILD {
|
||||
my ($job, $args) = @_;
|
||||
|
||||
if ($job->action =~ m/^(\w+)::(\w+)$/i) {
|
||||
$job->action($1);
|
||||
$job->only_namespace($2);
|
||||
}
|
||||
}
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=head2 summary
|
||||
|
||||
@@ -36,6 +36,13 @@ register 'register_worker' => sub {
|
||||
# check to see if this namespace has already passed at higher priority
|
||||
return if $job->namespace_passed($workerconf);
|
||||
|
||||
# support part-actions via action::namespace
|
||||
if ($job->only_namespace and $workerconf->{phase} ne 'check') {
|
||||
return unless $workerconf->{namespace} eq lc( $job->only_namespace )
|
||||
or (($workerconf->{phase} eq 'early')
|
||||
and ($job->device and not $job->device->in_storage));
|
||||
}
|
||||
|
||||
my @newuserconf = ();
|
||||
my @userconf = @{ setting('device_auth') || [] };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user