Skip to content

Commit

Permalink
apply roles to runlist before recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
xdg committed May 11, 2012
1 parent 6b5dc84 commit 21a164b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Pantry/App/Command/apply.pm
Expand Up @@ -78,12 +78,12 @@ sub _check_name {

sub _apply_runlist {
my ($self, $obj, $opt) = @_;
if ($opt->{recipe}) {
$obj->append_to_run_list(map { "recipe[$_]" } @{$opt->{recipe}});
}
if ($opt->{role}) {
$obj->append_to_run_list(map { "role[$_]" } @{$opt->{role}});
}
if ($opt->{recipe}) {
$obj->append_to_run_list(map { "recipe[$_]" } @{$opt->{recipe}});
}
return;
}

Expand Down
6 changes: 6 additions & 0 deletions t/app/apply.t
Expand Up @@ -40,6 +40,12 @@ my @cases = (
run_list => [ 'role[web]' ],
},
},
{
argv => [ qw/-r postfix -r iptables -R web/ ],
expected => {
run_list => [ qw/role[web] recipe[postfix] recipe[iptables]/ ],
},
},
{
argv => [ qw/-d nginx.port=80/ ],
expected => {
Expand Down

0 comments on commit 21a164b

Please sign in to comment.