Skip to content

model_path doesn't update when config_path is modified in wrapper cookbok #29

Description

@nozpheratu

The model_path is currently being computed based on the config_path value as seen below:

default['backup']['model_path'] = "#{node['backup']['config_path']}/models"

If you change the config_path attribute to point to something other than the /etc/backup default then the deploy will fail. Reason being, derived attributes aren't updated when the attributes they make use of get updated. In order for the value to be set correctly you either have to manually set the derived attribute in addtion to config_path, or use a role or environment. Since I'm using chef-solo I also have the option of setting config_path directly in the node file, but I'd like to avoid the duplication.

As mentioned in this blog post on derived attributes, an easy fix is to simply change model_path to be a variable that gets computed in the default recipe.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions