ahelal / kitchen-ansiblepush

test-kitchen plugin to use ansible in push mode
41 stars 22 forks source link

reference to uninitialized @machine_name ? #6

Closed wtanaka closed 8 years ago

wtanaka commented 9 years ago

As I was going through the code, this struck me as odd.

In this snippet, we refer to @machine_name if config[:limit] is false

        # By default we limit by the current machine,
        if config[:limit]
          options << "--limit=#{as_list_argument(config[:limit])}"
        else
          options << "--limit=#{@machine_name}"
        end

@machine_name is initialized in prepare_inventory if config[:generate_inv]

so it seems like there may be an issue if config[:generate_inv] is false and config[:limit] is also false since the code would refer to @machine_name but it wouldn't have been initialized?

ahelal commented 9 years ago

Yeah, you are right. As soon as your pull request is merged I would tackle that issue.