Skip to content

Commit ea345fd

Browse files
committed
Fix hostgroup membership list for all groups
1 parent 490cb14 commit ea345fd

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Revision history for Rex
44
[API CHANGES]
55

66
[BUG FIXES]
7+
- Fix hostgroup membership list for all groups
78

89
[DOCUMENTATION]
910

lib/Rex/Group.pm

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ sub new {
3030

3131
for my $group ( keys %groups ) {
3232

33-
if ( any { $_ eq $srv } $groups{$group}->get_servers ) {
34-
$srv->append_to_group($group);
33+
for my $host ( $groups{$group}->get_servers ) {
34+
if ( $host eq $srv ) {
35+
$host->append_to_group( $self->{name} );
36+
$srv->append_to_group($group);
37+
}
3538
}
3639
}
3740
}

0 commit comments

Comments
 (0)