saltstack / saltstack/salt

[DOCS] Migrating from grains.get_or_set_hash to sdb.get_or_set_hash

Open
#62,816 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-triage
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
According to the 3005 release note, grains.get_or_set_hash has been removed in favour of sdb.get_or_set_hash (#61691).

I've updated every occurrences of salt['grains.get_or_set_hash'](...) to salt['sdb.get_or_set_hash'](...) in the state tree. When applying it via sudo salt-call --local state.apply (note that I'm using salt in masterless mode), in place of the generated hash I had before, I'm now obtaining a False value.

Even the example from the documentation is failing to generate and return a value:

sudo salt-call --local sdb.get_or_set_hash 'SECRET_KEY' 50
local:
    False

I've tried to setup another database but none of the existing drivers seems to implement the .get_or_set_hash method.

Another question: previously, I was sharing the grains file across the nodes of the cluster trough a glusterfs mount point in order to share data between masterless minions (master-minion model is not suitable in this specific situation); when using default sdb database (documentation is unclear if a default database even exists or if one must necessarily define one with a specific driver), where is the data-storage located?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the 3005 release note, the sdb.get_or_set_hash reference, SDB configuration, and the listed SDB drivers. Reproduce the documented salt-call command, then clarify the migration behavior, default database configuration, and data-storage location in the relevant documentation, or document the correct limitation if the example is invalid.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
databases, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.