Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename_commands not populating rename-command #437

Open
project707 opened this issue Feb 21, 2021 · 0 comments
Open

rename_commands not populating rename-command #437

project707 opened this issue Feb 21, 2021 · 0 comments
Labels
Bug Something isn't working

Comments

@project707
Copy link

project707 commented Feb 21, 2021

πŸ‘» Brief Description

I need to rename but not remove destructive commands differently based on environment. For some reason I can't seem to get rename_commands to work via JSON environment files.

πŸ₯ž Cookbook version

4.1.1

πŸ‘©β€πŸ³ Chef-Infra Version

15.13.8

🎩 Platform details

Centos 7

Steps To Reproduce

Add rename_commands with a value that is a hash of commands and their new values to a JSON environment file.

  "override_attributes": {
   "redisio": {
      "rename_commands": {
        "FLUSHALL": "flushall_unsafe_34562",
        "FLUSHDB": "flushdb_unsafe_87451"
      }
    }
  }

πŸš“ Expected behavior

I should see something like this getting written into the config file:

# It is also possible to completely kill a command renaming it into
# an empty string:
#
# rename-command CONFIG ""

rename-command FLUSHALL "flushall_unsafe_34562"
rename-command FLUSHDB "flushdb_unsafe_87451"

################################### LIMITS ####################################

βž• Additional context

I can see the relevant code in redis.conf.erb (below), so I'm not clear why this isn't working for me, but nothing is written into that section

<% if !@rename_commands.nil? %>
  <% @rename_commands.each do |k, v| %>
    <% v = '""' if v.nil? || v.empty? %>
    <%= "rename-command #{k} #{v}" %>
  <% end %>
<% end %>
@ramereth ramereth added the Bug Something isn't working label Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants