def chef_installed(self): knife = "/opt/chef/bin/knife" command = "test -x %s" % (pipes.quote(knife)) version = self.options['version'] if version: command += (" && %s --version | grep %s" % (pipes.quote(knife), pipes.quote('Chef: %s' % (version)))) exit_code = shell.shell_out(command) return exit_code == 0
def install(self): return shell.shell_out(self.build_command(**self.options))