Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffbeck committed Aug 11, 2022
1 parent 7bbc25b commit da4ded2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
20 changes: 5 additions & 15 deletions sophomorix-samba/modules/SophomorixSambaAD.pm
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,6 @@ sub AD_dns_zonekill {

sub AD_gpo_listall {
my ($arg_ref) = @_;
my $json = $arg_ref->{json};
my $ref_sophomorix_config = $arg_ref->{sophomorix_config};
my $ref_result = $arg_ref->{sophomorix_result};
my %gpo=();
Expand Down Expand Up @@ -586,24 +585,16 @@ sub AD_gpo_listall {
}
}

# what to do/return
if ($json==-1){
return \%gpo;
} elsif ($json==0){
#print $gpo_listall_out;
#print "\n\n";
print $gpo_out;
} elsif ($json>0){
print Dumper(\%gpo);
}
return \%gpo;
# deprecated:
# print $gpo_out;
}



sub AD_gpo_get_uuid {
my ($gpo,$gpo_type,$ref_sophomorix_config,$ref_result)=@_;
my $ref_gpo=&AD_gpo_listall({json=>-1,
sophomorix_config=>$ref_sophomorix_config,
my $ref_gpo=&AD_gpo_listall({sophomorix_config=>$ref_sophomorix_config,
sophomorix_result=>$ref_result,
});
my $gpo_real="sophomorix".":".$gpo_type.":".$gpo;
Expand Down Expand Up @@ -826,8 +817,7 @@ sub AD_gpo_kill {

&Sophomorix::SophomorixBase::print_title("Killing gpo $gpo_real (start)");
# find out the iD of the named gpo
my $ref_gpo=&AD_gpo_listall({json=>-1,
sophomorix_config=>$ref_sophomorix_config,
my $ref_gpo=&AD_gpo_listall({sophomorix_config=>$ref_sophomorix_config,
sophomorix_result=>$ref_result,
});
my $uuid="";
Expand Down
6 changes: 4 additions & 2 deletions sophomorix-samba/scripts/sophomorix-school
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,10 @@ if ($school ne "" and $kill==1){

# --gpo-listall
if ($gpo_listall==1){
my $ref_gpo=&AD_gpo_listall({json=>-1,
sophomorix_config=>\%sophomorix_config,
if ($json==0){
$json=1;
}
my $ref_gpo=&AD_gpo_listall({sophomorix_config=>\%sophomorix_config,
sophomorix_result=>\%sophomorix_result,
});
&json_dump({json => $json,
Expand Down

0 comments on commit da4ded2

Please sign in to comment.