def new_kitchen():
    """Create LittleChef directory structure (Kitchen)"""
    def _mkdir(d, content=""):
        if not os.path.exists(d):
            os.mkdir(d)
            # Add a README so that it can be added to version control
            readme_path = os.path.join(d, 'README')
            if not os.path.exists(readme_path):
                with open(readme_path, "w") as readme:
                    print >> readme, content
            print "{0}/ directory created...".format(d)

    content = "# The /nodes directory contains your nodes as JSON files "
    content += "representing a node.\n"
    content += "# Example node file `nodes/myfqdn.json`:\n"
    data = {
        "chef_environment": "production",
        "apt": {"cacher_port": 3143},
        "run_list": ["recipe[apt]"]
    }
    content += "{0}".format(json.dumps(data, indent=2))
    _mkdir("nodes", content)
    _mkdir("roles")
    _mkdir("data_bags")
    _mkdir("environments")
    for cookbook_path in littlechef.cookbook_paths:
        _mkdir(cookbook_path)
    # Add skeleton config file
    if not os.path.exists(littlechef.CONFIGFILE):
        with open(littlechef.CONFIGFILE, 'w') as configfh:
            print >> configfh, "[userinfo]"
            print >> configfh, "user = "
            print >> configfh, "password = "
            print >> configfh, "keypair-file = "
            print >> configfh, "ssh-config = "
            print >> configfh, "encrypted_data_bag_secret = "
            print >> configfh, "[kitchen]"
            print >> configfh, "node_work_path = /tmp/chef-solo/"
            print "{0} file created...".format(littlechef.CONFIGFILE)
Create LittleChef directory structure (Kitchen)